Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environ and Multiple Form Query Criteria 1

Status
Not open for further replies.

alblunkproex

IS-IT--Management
Jun 25, 2008
18
US
Problem 1:

I have one report that gets emailed to other people on my network. That report is based on a query that reads the "requisition number" on either the "NewReq" form or the "EditReq" form.... It does work the way I want it to, but when you ask for the report the query prompts for the form that is closed at the time.... So if I have the NewReq form open and preview the report.... it prompts for the ReqEdit Number but then displays the Report.... Is there anyway to tell Access to Disregard if null?

Problem 2:

Im using the Environ function to automatically log people in to the DB and it works for everyone but Two... ive tried every option that I can find and it still does not find their name.... even though I have echoed it through the cmd and it does come up??? Anyone else relate?

Thanks.
 
2) write an append query that appends their userID to a table and have them just manually run it on their machines, then check it to make sure it's exactly what you have. i.e. copy/paste that exact result into your user table. maybe there's some space or hidden character or something.

1) report: you could make the button on each form that launches the report, and put the criteria into the report's recordsource in this button's code instead of in the current query. so the code that launches the report could be:

Docmd.OpenReport "ReportName",acviewpreview,,"ReqNumber = " & Me.ReqNumber

then in the query of the report, take out that criteria. put this code in the buttons on both forms. then no more problem.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
I like that approach, I get runtime error 3075 "syntax error(missing operator) in query expression '(Requisition Number=34642)'"

what am i missing?
 
Ginger, It works now... Heres a new predicament...

When I email a this report I run a macro based on the username they have on the main screen... The macroname is the same as their username and will send the same report I used for the print preview but now that query that the report is based on doesnt have the criteria... how do I set the requisition number and run that macro?
 
Ginger, you are awesome and thanks for the prompt reply. Thank you for that angle.... works now.. I figured it out...


Now onto the Username Problem.
 
Sorry I wasn't around today--glad you figured one thing out. Let us know about your username issue....

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top