|
-
Feb 20th, 2003, 03:16 PM
#1
Thread Starter
Member
searching for records
hi,
i have a datagrid and i am trying to search for certain records by means of a combobox. i seem to be going about it all wrong. this is the code i have to date
Private Sub searchid_Click()
Dim selected As String
If searchid.Caption = "Search By Cabinet Id" Then
selected = Combodateselect.Text
Adocosts.Recordset.Filter = "[Cabinet Id] > " & selected
searchid.Caption = "Cancel"
Else
DTservice1.Value = Date
Adocosts.Refresh
dbgservicecosts.Refresh
searchid.Caption = "Search By Cabinet Id"
End If
End Sub
can anyone help me with this thanks
-
Feb 20th, 2003, 03:42 PM
#2
-= B u g S l a y e r =-
-
Feb 20th, 2003, 03:48 PM
#3
Thread Starter
Member
ya i get an error saying
"Arguments are of wrong type, are out of the acceptable range or are in conflict with each other"
thanks
-
Feb 20th, 2003, 04:50 PM
#4
Frenzied Member
what line are you getting the error on?
-
Feb 20th, 2003, 05:02 PM
#5
Thread Starter
Member
the line
Adocosts.Recordset.Filter = "[Cabinet Id] > " & selected
-
Feb 21st, 2003, 01:13 AM
#6
-= B u g S l a y e r =-
what is the value of selected ?
-
Feb 21st, 2003, 05:21 AM
#7
Junior Member
if your datatype for [cabinet ID] is text, then you should do this:
adodc.recordset.filter=" [cabinet ID]>' " & string & " ' "
if your datatype for [cabinet ID] is number, then you should do this:
adodc.recordset.filter=" [cabinet ID]> " & clng(string)
-
Feb 21st, 2003, 06:04 AM
#8
Thread Starter
Member
Sorry selected is a string value
i tried that and it worked for me, thanks for your help
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
|