Alex,
Start making a new form in design view (not using the wizard!).
Add a listbox; as soon as the wizard opens, click Cancel. Then select
the listbox and open the Properties window (View > Properties, or right
click); select tab Data, and paste the following expression in the Row
Source property:
SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;
(all in one line, in case it gets wrapped in your newsreader)
Then select tab Other, and change the Name property from the default
(probably List0) to lstReports.
Next, add a command button; again, as soon as the wizard opens, click
Cancel. Like before, change the Name property from the default (probably
Command2) to cmdPreviewReport. Then go to tab Events and put the cursor
in the On Click property; click on the little button with the three dots
that appears on the right, and select Code Builder. You will be taken to
the VBA editor screen, and the cursor will be between two lines that
look like:
Private Sub cmdPreviewReport_Click()
End Sub
Paste the following code between them:
If IsNull(Me.lstReports) Then Exit Sub
DoCmd.OpenReport Me.lstReports, acPreview
Close the VBA window, and return to the form design; save and you're done.
HTH,
Nikos
Hi Everybody,
First of all thank you all for your work.
I am interesting in follows:
Have a small DataBase with tables, queries and several reports, want to make
a form with the Check Boxes and a button for choosing which report to
preview. Is it possible?
if it is please help me with this.