search by 1 of 3 combos
- From: miss031 <miss031@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 4 Feb 2007 20:54:00 -0800
I don't know what I am missing here. I have a form for viewing and editing
contact information, and I would like the user to be able to search by either
bid number (contact ID), phone number or name, then have the record details
displayed on the form.
I have 3 combo boxes, one for each search criteria, and the code for them is
based on a working search combo I have on another form, but they will not
work on this form. I'msure it is in the syntax, but I think I've made such a
mess now that I don't know where to start.
bidder_bidnumber is Text
contactprimphone is Integer
contactlastname is Text
source code:
Option Compare Database
Option Explicit
Private Sub cbo_find_by_bid_number_AfterUpdate()
Dim content
content = Trim(cbo_find_by_bid_number) & "*"
content = "[bidder_bidnumber] like '" & content & "'"
If cbo_find_by_bid_number <> "" Then
Me.Recordset.FindFirst content
' finds a particular bidder, and displays their information and
purchases on the form
End If
End Sub
Private Sub cbo_find_by_bid_number_GotFocus()
Me.cbo_find_by_bid_number.Value = ""
End Sub
Private Sub cbo_find_by_name_AfterUpdate()
Dim content
content = Trim(cbo_find_by_name) & "*"
content = "contactlastname like '" & content & "'"
If cbo_find_by_name <> "" Then
Me.Recordset.FindFirst content
' finds a particular bidder, and displays their information and
purchases on the form
End If
End Sub
Private Sub cbo_find_by_name_GotFocus()
Me.cbo_find_by_name.Value = ""
End Sub
Private Sub cbo_find_by_phone_AfterUpdate() ' "Find by Phone #" combo box
Dim content
content = Trim(cbo_find_by_phone) & "*"
content = "[contactprimphone] like '" & content & "'"
If cbo_find_by_phone <> "" Then
Me.Recordset.FindFirst content
' finds a particular bidder, and displays their information and
purchases on the form
End If
End Sub
Private Sub cbo_find_by_phone_GotFocus()
Me.cbo_find_by_phone.Value = ""
End Sub
.
- Follow-Ups:
- Re: search by 1 of 3 combos
- From: strive4peace
- Re: search by 1 of 3 combos
- Prev by Date: RE: select query criteria
- Next by Date: Re: tab controls setting focus
- Previous by thread: Make the active x WindowsMediaPlayer0 Play My files!!1
- Next by thread: Re: search by 1 of 3 combos
- Index(es):
Relevant Pages
|
Loading