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

VBA on Access Report 1

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
Ive got a report, where in certain circumstances I need to display some text boxes at the bottom.

So, Ive got a subroutine that runs a query. If that query contains data, then I make the text boxes visible, and populate them.

If that query contains no data, then I make the text boxes disappear.

If I call this code from the Report_OnLoad event, then nothing happens (apart from an error, as the record id has not yet been initiated)

If I call it from the OnActivate, then it runs, and if I preview the form, it runs and populates the data. However, if I do this in the live applcation, nothing happens (Im not even convinced that the OnActivate method is being called, as the report is generated and sent immediately to the print queue.

So, whats the best strategy of programatically populating some form values, based on a query.

Am I going to have to do an outer join, and populate the text boxes as part of the main form query? (I say outer, as there may not be data in the table that I use to populate the textboxes!)

Hope thats all self explanatory

K
 
Have you considered using a subform? Subforms do not show if there is no data.
 
The page already has a number of subforms, I guess thats the obvious way to go though, I'll give it a shot

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top