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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search from

Status
Not open for further replies.

gasx

Technical User
Feb 28, 2003
22
US
I have a main form holding my customers information like first name last name telephone number, etc.
I would like to create another seach form with one text
box and command buttom. I want to write phone number or date of birth on the text box and click "ok" this form with one text box closed and main form my customer form open with that record I select.Pleasr help if you understand what I mean.
 
I think you're making it more complicated than it needs to be. Why not just include 2 comboboxes in the FormFooter of your form. The first combobox will list the name sorted by last name. The second combobox will list the phone numbers (sort if you want). Then the user can either type the name (or phone number) they want or select it from the list. In the AfterUpdate event of each combobox, insert some code something like this. Note that this concept will also work in a popup form as your 1st post indicated.

Private Sub cboLastName_AfterUpdate()

If (Not IsNull(cboLastName)) Then
Me.RecordsetClone.FindFirst "strLastName = '" & cboLastName & "'"
If (Me.RecordsetClone.NoMatch) Then
MsgBox "Can't find name entered. Try again."
Else
Me.Recordset.Bookmark = Me.RecordsetClone.Bookmark
End If
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top