AKK
07-21-2009, 10:20 AM
I'm trying to write a VBA command for opening a report (from a form with controls for calling the macro below once the user has entered the appropriate data) -- I've found a few resources on what the proper syntax is, but it looks like I'm still doing something wrong. Currently:
Option Compare Database
Private Sub cmdCancel_Click()
DoCmd.Close acForm, "LookupCharterSummaryTEST"
End Sub
Private Sub cmdOK_Click()
DoCmd.OpenReport "Charter Summary TEST", acViewPreview, "Charter Summary"
DoCmd.Close acForm, "LookupCharterSummaryTEST"
End Sub
I'm not sure if I'm entering the filter argument correctly ("Charter Summary" is the name of the query that the report "LookupCharterSummaryTEST" is built on), and I'm unclear on what to enter for the WindowsMode & OpenArgs arguments.
This is all pretty new to me, so if you could be as specific about the syntax as possible, I would really appreciate it (ie, don't assume I know where to use commas, brackets, quotation marks, etc). Thanks so much!
Option Compare Database
Private Sub cmdCancel_Click()
DoCmd.Close acForm, "LookupCharterSummaryTEST"
End Sub
Private Sub cmdOK_Click()
DoCmd.OpenReport "Charter Summary TEST", acViewPreview, "Charter Summary"
DoCmd.Close acForm, "LookupCharterSummaryTEST"
End Sub
I'm not sure if I'm entering the filter argument correctly ("Charter Summary" is the name of the query that the report "LookupCharterSummaryTEST" is built on), and I'm unclear on what to enter for the WindowsMode & OpenArgs arguments.
This is all pretty new to me, so if you could be as specific about the syntax as possible, I would really appreciate it (ie, don't assume I know where to use commas, brackets, quotation marks, etc). Thanks so much!