Filter by field and show report

graveyard

Registered User.
Local time
Yesterday, 20:49
Joined
Mar 26, 2011
Messages
55
hi all, i have created a combo list named "Country" and also a combo button on the form to link to report - pls see attached file

i have the relevants tables and report

may i know how do i design in such as way the "Country" combo list will have a drop down list (content is SG, HK) that links to the relevant report based on my selection from the list
(e.g when i select SG from the drop down list and click the combo button, it will open the report based on SG and same for HK)?

do i need to create 2 separate reports? my current report has SG + HK data together. not sure if it is possible to program the combo button to lookup the value in the "Country" list and return me the relevant report

Many thanks ppl for reading. Pls advise
 

Attachments

  • printscreen.jpg
    printscreen.jpg
    5.1 KB · Views: 188
"Doesn't work" isn't very helpful in trying to figure out what's wrong. If it's printing, you've missed the preview option. Review OpenReport in VBA help to see the appropriate argument and position.
 
"Doesn't work" isn't very helpful in trying to figure out what's wrong. If it's printing, you've missed the preview option. Review OpenReport in VBA help to see the appropriate argument and position.

Sorry paul, am giving more info now.

i want to view it in preview mode first so i guess i have to add in "acViewPreview" and "acnormal" - how do i insert these into the code on your website.

My current code as follows:
--------------------------
Private Sub cmdApplyFilter_Click()
DoCmd.OpenReport "Country Submission Template", acViewPreview, "", "", acNormal, "ORIGINAL = '" & Me.cmdApplyFilter & "'"
End Sub
--------------------------
where cmdApplyFilter = name of control button, Country Submission Template = report name, ORIGINAL = fieldname which i use to filter the data

Pls advise. thanks
 
If you read help, you want preview, not normal (normal prints out the report). Tr

DoCmd.OpenReport "Country Submission Template", acViewPreview, ,"ORIGINAL = '" & Me.cmdApplyFilter & "'"
 
If you read help, you want preview, not normal (normal prints out the report). Tr

DoCmd.OpenReport "Country Submission Template", acViewPreview, ,"ORIGINAL = '" & Me.cmdApplyFilter & "'"

hi paul, many thanks. Sorry i didnt know what the acnormal do actually. i got it working with your code now. Appreciate your patience!
 

Users who are viewing this thread

Back
Top Bottom