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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 ADP code question

Status
Not open for further replies.

TerryW34

MIS
Dec 7, 2012
11
US
Morning everyone,

If this post is in the wrong form, please forgive me. Also my VB coding is very limited.

I am working on a Access 2007 ADP connected to a Ms-Sql database. My current issue is with displaying a report on the screen that uses a query(stored procedure in the ADP) with a prompt in it. Trying to prompt the user via two different command buttons, one to inquire by asset number and the second command button (both from a menu) to enter a pair of dates, to be able to review what occured when a person was off for a few days, but in both cases want to keep the data read only. When I attempt to create an event procedure (on click) and use the following

DoCmd.OpenReport "reportname", AcViewPreview

When this is done, a message is given that the code is incorrect and no matter what options I add it still fails.

If however, I do the following:

DoCmd.OpenReport "reportname"

Then it wants to print the report rather than viewing on screen.

A bit confused and looking for guidenance and direction on how to approach this problem. Any help would be appreciated.

Regards,
Terry


 
a message is given that the code is incorrect"
What is the message and error code? If it's error 2501 it means there is no data to print and can be resolved by adding cancel = true to the Report's On No Data event.

Beir bua agus beannacht!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top