Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables and sstab

Status
Not open for further replies.

maybe

Instructor
Jul 11, 2001
14
0
0
GB
This may be easy but I'm new to VB

I have set up a form using two sstabs, I have set up textFields on tab 1 that is populated from a databse, all works fine, however I want to add a search facility on the first tab. I have used the code below on a normal form and all works fine, However when I use the code below on the first tab I get a compile error Variable not defined can anyone help.

Private Sub cmdFind_Click()
prompt$ = "Please enter Company ID Number."
'get string to be used in the CompanyID field search
SearchStr$ = InputBox(prompt$, "Customer Search")
Data1.Recordset.Index = "CompanyID" 'use CompanyID
Data1.Recordset.Seek "=", SearchStr$ 'and search
If Data1.Recordset.NoMatch Then 'if no match
Data1.Recordset.MoveFirst 'go to first record
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top