469,602 Members | 1,912 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

Incorrect data on opened form based on SQL View

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

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

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!

m b charney at sbcglobal dot net

Nov 13 '05 #1
0 1248

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by pmud | last post: by
reply views Thread by Wayne Aprato | last post: by
reply views Thread by JohnM | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.