syntax error!

tubar

Registered User.
Local time
Today, 17:02
Joined
Jul 13, 2006
Messages
190
i look up a light bulb it opens a form. on that form i hit a button to get more info on that same lamp...but i get the error

SYNTAX ERROR (MISSING OPERATOR) IN QUERY EXPRESSION 'LAMP ID=95'

Here is the code i am using

Private Sub AddDeleteSuppliers_Click()
On Error GoTo Err_AddDeleteSuppliers_Click


Screen.PreviousControl.SetFocus
DoCmd.OpenForm "order specific", , , "lamp id = " & Me.Text91



Exit_AddDeleteSuppliers_Click:
Exit Sub

Err_AddDeleteSuppliers_Click:
MsgBox Err.DESCRIPTION
Resume Exit_AddDeleteSuppliers_Click

End Sub



suggestions?????
 
You need brackets because the field name has spaces (another good reason why to NOT have spaces in your field or object names):

DoCmd.OpenForm "order specific", , , "[lamp id] = " & Me.Text91
 
very good part on the space mention....and thank you so much for the help
 
now the bonus question

what if the second form i am opening is an order form (data entry) how do i get the [lamp id] into the id box
 
One way:
Code:
DoCmd.OpenForm "order specific", , , "[lamp id] = " & Me.Text91
Forms("order specific").Controls("lamp id").Value = Me.Text91
 

Users who are viewing this thread

Back
Top Bottom