G
Guest
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
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