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, Skil2, so on up to 8 is a field(s) on a report
basicily I have 8 Combo boxes where a user picks one in each Combo box and
clicks on the print button(in a form) which sends that field(s) to a report
for
printing. the report has 8 seperate fields inwhich I want the values in the
Combo box to display. I also am having problems with the field(s) in the
report a parameter box keeps coming up how do I stop this.
Please can someone help me!!
Thank You for any help!!
[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, Skil2, so on up to 8 is a field(s) on a report
basicily I have 8 Combo boxes where a user picks one in each Combo box and
clicks on the print button(in a form) which sends that field(s) to a report
for
printing. the report has 8 seperate fields inwhich I want the values in the
Combo box to display. I also am having problems with the field(s) in the
report a parameter box keeps coming up how do I stop this.
Please can someone help me!!
Thank You for any help!!