By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,226 Members | 1,435 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,226 IT Pros & Developers. It's quick & easy.

Incorrect data on opened form based on SQL View

P: n/a
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

Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.