Call reports from option buttons

G

Guest

Hi,

I have an option button group (frClients) from which I want to consecutively
call up and print different reports depending on the option selected. Each
report is based on its own parameter query, and all queries run on the same
database table. But while I can always get the first option to print, the
next option selected gives me the error "The record souce "Dev Bank"
specified on this form or report does not exist", even though it is specified
in the Report properties? Can anyone help me?

The code used is as follows:

Private Sub PrintTime_sheets_Click()
frClients.Visible = True
End Sub

Private Sub Option22_GotFocus()
DoCmd.OpenReport "rptAfrican Bank"
DoCmd.Close acQuery, "qryAfrican Bank"
End Sub

Private Sub Option24_GotFocus()
DoCmd.OpenReport "rptDev Bank"
DoCmd.Close acQuery, "qryDev Bank"
End Sub
 
D

Duane Hookom

Do you have a table or query named "Dev Bank"?

I hope all your reports have different formats and not just different
recordsets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top