Combobox into a report

  • 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, 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!!
 
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
 
I am still have the problem of blanks or #name on the report. I have noticed
that the filter is working, but the out come is the same. The constant in the
report shows the filter, but the fields in the report are not there....
Please help! Thank You!


Ofer said:
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
--
I hope that helped
Good luck


Amour said:
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!!
 
Does your report bounded to te right table (Record source of the report)?

Are the fields control source property apear in the table?
--
I hope that helped
Good luck


Amour said:
I am still have the problem of blanks or #name on the report. I have noticed
that the filter is working, but the out come is the same. The constant in the
report shows the filter, but the fields in the report are not there....
Please help! Thank You!


Ofer said:
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
--
I hope that helped
Good luck


Amour said:
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!!
 
I am sorry, but I don't see what that has to do with. I am taking
information from a combobox and trying just to print it example: Combo1 =>
Skil1 were combo1 is information that a user selects from a drop down and
presses the print button, then that information goes to the field skil1 on
the report. Maybe I just don't understand I am a little new to Access. also
I am getting for Skil1 and so on a prompt for that field "Enter Parameter
Value" msg. when report opens. And I don't want that prompt to come up at
all. Thank You for any help!

Ofer said:
Does your report bounded to te right table (Record source of the report)?

Are the fields control source property apear in the table?
--
I hope that helped
Good luck


Amour said:
I am still have the problem of blanks or #name on the report. I have noticed
that the filter is working, but the out come is the same. The constant in the
report shows the filter, but the fields in the report are not there....
Please help! Thank You!


Ofer said:
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
--
I hope that helped
Good luck


:

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!!
 
Back
Top