I have a form that has a search button on it. The form has three text boxes,
last name, first name, and bidder number. I put in a last name and click the
search button. Clicking the search button opens another form based on a SQL
view.
What is supposed to happen is the search results form opens based on the
information entered in one of the controls (Last Name, First Name, Bidder #)
Here is the code:
===Begin Code===
If Not IsNull(Me.Text18) Then
lstnme = Me.Text18
DoCmd.OpenForm "frmSearch_Results", , , "[last_name] = '" &
lstnme & "'"
Forms![frmSearch_Results].[Source_Control] = srce
DoCmd.Close acForm, "frmCustomer_Search", acSaveNo
Exit Sub
End If
===EndCode===
What actually is happening is the results form opens, but NOT with the name
I have entered. The If statement above has two other else section that are
the same except that they check for either first name or bidder # entries.
The open form command has the WHERE section surrounded by single quote
marks. No matter what I put in the last name control on the search form it
comes back with the last name Bollman.
How do I get the form to open based on the name I put in?
Thanks in advance!
Mike
m b charney at sbcglobal dot net