Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull Down Menus to bring up reports

Status
Not open for further replies.

Castanz

Programmer
Apr 5, 2002
61
0
0
US
I hope this is really easy, but I haven't figured it out yet. I want to run a report based on a pulldown menu. Right now I have in my queries [Type in the name of the class for the report] in the class colomn. My report uses the query for the record source. To get an accurate class name the user has to copy and paste the name of the class in the field. Classes can vary by one or two letters. Can anyone help me with this. -Thanks, Castanz
 
Sorry - I put the wrong link in. Try this one instead:
thread181-538495
 
Thanks, JrBarnett
This is the code I used. I didn't have a subform:
Private Sub Open_rep_Click()
On Error GoTo Err_Open_rep_Click

Dim stDocName As String
Dim strWhereCond As String
Dim strDivision As String

stDocName = "Single Division"
strDivision = Me.Division
strWhereCond = "Division='" & strDivision & "'"
DoCmd.OpenReport stDocName, acViewPreview, , Wherecondition:=strWhereCond

Exit_Open_rep_Click:
Exit Sub

Err_Open_rep_Click:
MsgBox Err.Description
Resume Exit_Open_rep_Click

End Sub

I made the Combobox save to a temporary table with a division field. This seemed to work fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top