Macro reports

J

Jo K.

I have the following fields in a table.
-JobNo (primary key)
-Assessor (combo box containing only two names to choose from ie. John,
Bill)
I have created two seperate reports which have exactly the same content
except that they have a different electronic signatures respective of the
person chosen from the Assessor combo box.
ie. Rpt_John and Rpt_Bill
To produce these reports, I currently have two macro's (one for each of the
two assessors) in a form (frm_main) whereupon clicking a particular macro
button (ie button named BILL), popup dialogue box (running a query....
qry_rpt_assessor) asks for the JobNo. Upon entering the number, the report
is produced based on the info that the particular jobno contains respective
to the assessor.
My question is: How can I create a macro or code that when the user is in a
particular record (jobno) that a report will be produced based on info that
is already there ie jobno and the assessor foregoing the prompt. So with
one click of the macro button, the report will be produced without any input
from the user ie. the report being able to gather the information from the
current jobno that the user is in and the assessor's name that has populated
the Assessor field box.
thanks for any help.
 
G

Guest

Hi Jo,

Base your reports on a query with the relevant fields
In the criteria of the JobNo enter
[forms]![frm_myform].[JobNo]
where frm_myfrom = the form you are viewing

On the On_Click event of the print button onyour form enter code as follows

if ([ComboBox]) = Bill then
Docmd.OpenReport "rpr_Bill", acViewPreview,"","",acNormal
else
Docmd.OpenReport "rpr_Johnl", acViewPreview,"","",acNormal
end if

where combobox = the name of the combobox you use to select bill or john

The above will preview the report that is currently displayed in either Bill
or John mode depending which name has been selected

hope thats helpful
 

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