Combo box select critieria for a report

Ste4en

Registered User.
Local time
Today, 16:36
Joined
Sep 19, 2001
Messages
142
This little bit of code is not working for me:

combo0 looks at a list of iso's (SELECT [WELDS].[ISO NUMBER] FROM WELDS; ). Format is like these:
D-1-1E-0237-03 or
seal-1E-0232-03

I select the iso in the combo box and get an "enter parameter value" for "D" if I selected the first example above or "seal" if I selected the last.

What have I done wrong. Thanks


Private Sub Command2_Click()

Dim stlinkcriteria As String
Dim stdocname As String

stdocname = "traveler"
stlinkcriteria = "[iso number]=" & Me![Combo0]
DoCmd.OpenReport stdocname, acViewPreview, , stlinkcriteria

End Sub
 
It seems I am missing a set of quotes....


This is being passed to the report
([iso number]=S-59-1E-0231-02)

but I need

([iso number]="S-59-1E-0231-02")

What do i need to change.
thanks
 
Last edited:
and here is the answer:

stlinkcriteria = "[iso number]= '" & Me![Combo0] & "'"

it won't let you enter " " " but " ' " does it.


Problem solved.
 

Users who are viewing this thread

Back
Top Bottom