|
-
Aug 15th, 2000, 08:54 AM
#1
Thread Starter
Junior Member
I'm trying to create a command in a form that will sort the data in the form by ascending or descending order. I am currently trying to use a toggle switch, and using the following code:
Dim str As String, tgl As ToggleButton
str = "Customers_CompanyName"
Set tgl = tglCustomer
Select Case tgl.Value
Case True
Me.OrderBy = str & " DESC"
Me.OrderByOn = True
Case False
Me.OrderByOn = False
Case Else
Me.OrderBy = str
Me.OrderByOn = True
End Select
The toggle button is a MicrosoftFormsLibrary2.0 toggle switch.
When I run this, I usually get a 'type mismatch' error.
Are there better ways to do what I'm doing?
-
Aug 15th, 2000, 10:16 AM
#2
New Member
I am not that expirienced, so if I'm wrong it's understandable and I am sorry for bothering you, but it seems to me you are trying to assign a string to a logical value
Me.OrderBy = str
I know in other languages this could be the problem
-
Aug 15th, 2000, 10:19 AM
#3
Thread Starter
Junior Member
Nevermind, I got it sorted out.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|