Hi I would really like help with my combo boxes.. I have three of them.. and what i would like to do is after youve chosen a choice in these boxes you can klick a command button and get the report... but the thing is i dont know how... i started off with only two.. and the code ended up like this...
Private Sub runquery_Click()
On Error GoTo Err_runquery_Click
' set up constants and variables
Dim WClause As String
Const Rview = "acViewPreview"
Const SView = "SelectRelations" ' this is a query
' I am using a query to combine results
' from two linked tables
Const RName = "Reportname"
' this is a report
' get the parameters from the combo boxes
WClause = "[SelectRelations].[Country] = '" & Me.CountryCombo & _
"' AND [SelectRelations].[Event] = '" & Me.EventCombo & "'"
' Open the report in preview mode
DoCmd.OpenReport _
Reportname:=RName, _
View:=acViewPreview, _
Filtername:=SView, _
WhereCondition:=WClause
Exit_runquery_Click:
Exit Sub
Err_runquery_Click:
MsgBox Err.Description
Resume Exit_runquery_Click
End Sub
donno if there is anything wrong with it... but it doesnt seem like it... cause when i press the command button i get a box that says enter parameter value.. im going nuts here so i would appreciate if someone could help me.. thx
Private Sub runquery_Click()
On Error GoTo Err_runquery_Click
' set up constants and variables
Dim WClause As String
Const Rview = "acViewPreview"
Const SView = "SelectRelations" ' this is a query
' I am using a query to combine results
' from two linked tables
Const RName = "Reportname"
' this is a report
' get the parameters from the combo boxes
WClause = "[SelectRelations].[Country] = '" & Me.CountryCombo & _
"' AND [SelectRelations].[Event] = '" & Me.EventCombo & "'"
' Open the report in preview mode
DoCmd.OpenReport _
Reportname:=RName, _
View:=acViewPreview, _
Filtername:=SView, _
WhereCondition:=WClause
Exit_runquery_Click:
Exit Sub
Err_runquery_Click:
MsgBox Err.Description
Resume Exit_runquery_Click
End Sub
donno if there is anything wrong with it... but it doesnt seem like it... cause when i press the command button i get a box that says enter parameter value.. im going nuts here so i would appreciate if someone could help me.. thx
