G
Guest
Hello-
I am having a problem with DoCmd.OpenQuery syntax. Can you help me with
proper syntax. I want to open a query that is specified in a form list box
(users select the query they want and click submit).
[Report Generator] = Form name
[reportFileName] = name of query
Here is the code I have been working with:
Private Sub Command60_Click()
DoCmd.OpenQuery [Forms]![Report Generator]![reportFileName]
End Sub
Also, do you know how I can add in some logic so if the file name selected
in the list box is a query than open the query, otherwise open a report. I
was thinking something like this.
if field x = x
then OpenQuery [Forms]![Report Generator]![reportFileName]
else OpenReport [Forms]![Report Generator]![reportFileName]
I am having a problem with DoCmd.OpenQuery syntax. Can you help me with
proper syntax. I want to open a query that is specified in a form list box
(users select the query they want and click submit).
[Report Generator] = Form name
[reportFileName] = name of query
Here is the code I have been working with:
Private Sub Command60_Click()
DoCmd.OpenQuery [Forms]![Report Generator]![reportFileName]
End Sub
Also, do you know how I can add in some logic so if the file name selected
in the list box is a query than open the query, otherwise open a report. I
was thinking something like this.
if field x = x
then OpenQuery [Forms]![Report Generator]![reportFileName]
else OpenReport [Forms]![Report Generator]![reportFileName]