|
-
Apr 11th, 2000, 09:46 PM
#1
Thread Starter
Junior Member
You gotta help me Im Going mental!!
I need to search through a database for a colour but if its not in the first Coloumn I need VB to Check The other 3 can anyone help
What I created is below!!!
Stop laughing!!
Private Sub Command4_Click()
prompt$ = "Enter the full (complete) Carpet Colour."
SearchStr$ = InputBox(prompt$, "Carpet Search")
Data2.Recordset.Index = "colour 1"
Data2.Recordset.Seek "=", SearchStr$
If Data2.Recordset.NoMatch Then
Data2.Recordset.Index = "Colour 2"
Data2.Recordset.Seek "=", SearchStr$
If Data2.Recordset.NoMatch Then
Data2.Recordset.Index = "Colour 3"
Data2.Recordset.Seek "=", SearchStr$
If Data2.Recordset.NoMatch Then
Data2.Recordset.Index = "Colour 4"
Data2.Recordset.Seek "=", SearchStr$
If Data2.Recordset.NoMatch Then
Data2.Recordset.MoveFirst
End If
End If
End If
End If
End Sub
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
|