Comboxbox Value(s) into a report field(s)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I keep getting Syntax error(missing operator) in query expression '(And
[Skil1] = 'name')'

Dim qrystring As String
Dim fieldresult As String
Dim totalnumber As Integer
Dim reportname As String
reportname = Me!reptname
printit = True
If IsNull(Forms!frmExperienceFilter!frmPersExperience.Form!Combo2) Then
MsgBox "You need to pick at least one Skills Set!"
Forms!frmExperienceFilter!frmPersExperience.Form!Combo2.SetFocus
printit = False
Else
filtexper1 =
Forms!frmExperienceFilter!frmPersExperience.Form!Combo2
qrystring = qrystring & "' AND [Skil1] = '" & filtexper1 & "'"
If Not
IsNull(Forms!frmExperienceFilter!frmPersExperience.Form!Combo3) Then
filtexper2 =
Forms!frmExperienceFilter!frmPersExperience.Form!Combo3
qrystring = "[Skil2] = '" & filtexper1 & "' And [Skil2] = '" &
filtexper2 & "'"
End If
End If
If printit Then
DoCmd.Close
DoCmd.OpenReport reportname, A_PREVIEW, , qrystring
End If

Skil1 is a field on a report Skil2 is a fiel on same report Skil3 and so on
up to 8
basicily I have 8 Combo boxes where a user picks one in each Combo box and
clicks on the print button which sends that field(s) to a report for
printing. the report has 8 seperate fields (these field(s) are not dependent
on a table or query) inwhich I want the values in the Combo box to display.
I also am having problems with the fields in the report a parameter box keeps
coming up how do I stop this.
Please can someone help me!!
Thank You for any help!!
 
In the code you provided us with, I can't see where you declared the
filtexper1 or filtexper2 variables

Dim filtexper1 as string
Dim filtexper2 as string
 
Back
Top