use one form for various reports

  • Thread starter alhindson via AccessMonster.com
  • Start date
A

alhindson via AccessMonster.com

i've created a form for our staff to enter various info for insurance
companies. I've tried to make it fool proof by using a drop down menu for
them to choose Insurance#1, Insuarance#2...etc.

Once they enter their data they have an option to print this...however, each
Insuarance has a different "style" of report they require this info to be
printed on. I've created 4 different reports per each insurance companies
requirements.....but I can't figure out how to create it so when they choose
"Insurance#1" from the drop down menu...the report option will point to
"Report_Insurance#1"

Is this possible??

Thanks for any help!!
 
R

Ryan

You would need to code the click event of a button to run the report, or the
after update event of the drop down. Not know which would work better for
you I will give you an example of a command button.

Private Sub RunReport_Click()
Dim InsuranceCompany as string
InsuranceCompany = Me.NameOfTheInsuranceCompanyDropdown

Select Case InsuranceCompany
Case "Insurance#1"
DoCmd.OpenReport "ReportNameForInsurance#1"
Case "Insurance#2"
DoCmd.OpenReport "ReportNameForInsurance#2"
End Select
End Sub
 
A

alhindson via AccessMonster.com

YEEE HAW!! This Worked! Thanks so much for the quick response.....

ok just a few more questions to make it perfect.....So when it does it, it
ends up putting ALL the issues that are in the table so more than just a one
page report..how can I only make it pull the one that is on the screen (or in
use at the time)--not all that have been logged in the past too??

Also...if I have one "generic report"...which if it doesn't fall in
Insurance#1,Insurance#2 or Insurance#3 than I want it to use the
GenericReport? can I do this as a global assumption rather than list all the
other Insurance Names individually??

THANKS AGAIN--THIS WAS AWESOME!!
 
A

alhindson via AccessMonster.com

OK so I read through some other threads and figured out how to make it only
do the form I was on! YEAH!....

But still not to do the "If not these..than print on generic report".....any
thoughts!!


thank you, thank you, thank you......
 
B

Beetle

Select Case InsuranceCompany
Case InsuranceCompany1
DoCmd.OpenReport "rptInsuranceCompany1"
Case InsuranceCompany2
DoCmd.OpenReport "rptInsuranceCompany2"
Case Else
DoCmd.OpenReport "rptGenericReport"
End Select
 
R

Ryan

Beetle is correct, just add a Case Else at the end of the Expresion.

Case Else
Docmd.OpenReport "rptGenericReport"
End Select
 
A

alhindson via AccessMonster.com

YES! Thank you BOTH so much!! you are AWESOME!!

Worked like a charm!!

You've made my week!!
 

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