Hi Dhaval
It depends on what you want to do.
A simple method would be to create a number of macros and then link this to
an ONClick event of a number of buttons – but your form may start to look
quite full quite quickly.
Or
You could create a single macro with a few report (to print) and then link
this to an AfterUpdate of a list or combo (bound colum) with the Report Names
in the bound column.
Or
If you have specific reports that you want to filter so that users can send
out (as an example) a sales confirmation, or a letter regarding a telephone
call, etc, etc (assuming that each client has a [BookingRef]
You could create a combo box (Print-Select) with the names of the reports
and OnClick you could use
Private Sub PrintSelect_Click()
If (Forms!NameOfMainForm!NameOfSubForm!PrintSelect = "Report1") Then
DoCmd.OpenReport "Report1", acViewNormal, "",
[BookingRef]=[Forms]![NameOfMainForm]![NameOfSubForm].[Form]![BookingRef]",
acNormal
End If
If (Forms!NameOfMainForm!NameOfSubForm!PrintSelect = "Report2") Then
DoCmd.OpenReport "Report2", acViewNormal, "",
[BookingRef]=[Forms]![NameOfMainForm]![NameOfSubForm].[Form]![BookingRef]",
acNormal
End If
If (Forms!NameOfMainForm!NameOfSubForm!PrintSelect = "Report3") Then
DoCmd.OpenReport "Report3", acViewNormal, "",
[BookingRef]=[Forms]![NameOfMainForm]![NameOfSubForm].[Form]![BookingRef]",
acNormal
End If
Etc, Etc.
I would suggest starting with a simple macro to run/print your reports and
then use the OnClick action of your new button on your form. After you have
this up and running you could start to look at some VBA (make a copy of your
D Base) and this to practice on.