-
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
-
stop bloody posting the same question.
Have you no patience that man.
[Edited by Iain17 on 04-12-2000 at 04:07 PM]
-
perhaps he's trying to upgrade himself to "Member" status :)
-
Hear me now....
RHYS,
This ****ing project is driving me chicken oriental. I've managed to get a word document to occur onto a form but i need to edit it (add new invoice numbers) and then print it out.
The Boy Ben
-
Ben, see the code above...what do u think is wrong with it? when ever I run it it says that "Colour 1" is not an Index but this code works fine for the carpet look up
VB HAS SERIOUS AND DEEP ROOTED ISSUES!!!!!
Im going to get some stella and have another look at it then gboy
Rhys
PS
I have no ideas 4 your little problem there!!