Access Forms Queries

I do not want the second form to query due to no paramaters entered (seems like On Open might help but not sure how to do it).

What I would like is to access the second form from the main page and have the two reports below show zero record (without going throught the query process).  

How the database currently works

Step 1 - From main page "Button One-Components is pressed.
Step 2 - Form "Component Form Page" is opened.
Step 3 - Access automatically runs Query 1 and Query 2 as a means to populate Report 1 and Report 2 even though there are no parameters (wastes time).

Can you help?

Main Form

                           
Button one - Components
 
                                                                                                                             Submit Button


Second Form "Component Form Page"

                           
Input One
                           
Input Two

                            Report 1  Query 1

                            Report 2  Query 2
LVL 3
gazdzidAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hnasrCommented:
Upload a sample database and direct us what to do to experience the problem.
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Why does "Access automatically runs Query 1 and Query 2"? The only time Access will "automatically" do something is if you've told it to, or if you've bound an object (like a Form or Report) to that query. If you only want the second form to open your reports AFTER the two parameters are entered, then check for those values before you run code that opens the report:

If Nz(me.ParameterOne, "") = "" Then
  Msgbox "You must enter Parameter One"
  Exit Sub
End If

If Nz(me.ParameterTwo, "") = "" Then
  Msgbox "You must enter Parameter Two"
  Exit Sub
End If

DoCmd.OpenReport "YourReport" etc etc

Obviously you'd have to change that to match field and Report names in your project.

Note that if you're using 2010 or higher, and you've Embedded those reports on the Form, then Access will always try to run them. The only way around that would be to remove the SourceObject value from those embedded SubReport objects, and set them only when your parameters tests above are completed.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anthony PerkinsCommented:
Topics: Microsoft Access Database ,MS SQL Server
Does this question have anything to do with MS SQL Server?
0
MacroShadowCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Scott McDaniel (Microsoft Access MVP - EE MVE ) (http:#a40196535)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

MacroShadow
Experts-Exchange Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.