Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Button Blues

Status
Not open for further replies.

benu302000

Programmer
Aug 11, 2004
23
0
0
US
Ok, I've got a command button on a form that opens up a new form populated by data thats related to a control in the old form. It was work a moment ago, and now I'm getting an error that says "Syntax error (missing operator) in query expression "[Billet Number]=" heres my code for the button



Private Sub update_billet_Click()
On Error GoTo Err_update_billet_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Billet Table"
stLinkCriteria = "[Billet Number]=" & Me![Combo8]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_update_billet_Click:
Exit Sub

Err_update_billet_Click:
MsgBox Err.Description
Resume Exit_update_billet_Click

End Sub


I'm new to VB so I might just be missing a syntax glitch. thanks
 
Are you sure Combo8 is populated and has a selected value when the button is clicked ?


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
that tells me that when you run
Code:
stLinkCriteria = "[Billet Number]=" & Me![Combo8]

then Combo8 is null
because if Combo8 is null then
srLinkCriteria would = "[Billet Number]="

So I would check the control source in Combo8 and make sure your bound column property in Combo8 is set to the column to the values you want to pass.

Brought to you By Nedaineum
|
|
The port to Geektron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top