Opening a report instead opens a form (which opens a report)?

  • Thread starter Thread starter NaClO2
  • Start date Start date
N

NaClO2

Guest
Hi,

I've been given an existing database to modify, and I'm struggling somewhat to see how the author has implemented certain functions.

On a main menu form (autoexecs on starting the database), there are various "Search By" option buttons to generate a report, ordered in various ways. The "On Click" field for each of them refers to a macro, called Buttons, and a line in that macro dependant on the type of search (e.g. OnClick = Buttons.byPerson).

The Buttons macro runs an OpenReport command, the report corresponding to the search type (e.g. Buttons.byPerson has an OpenReport command for the "Report by Person" report).

However, when I click the search buttons (or indeed run the corresponding reports) I instead get another form which allows the search criteria to be specified - this then generates the report (I would assume based on the relevant query - e.g. Person Query), but I cannot understand how this works.

Google searches have not helped much as I can't seem to find an adequate search phrase to use, and I've been staring at the thing for some hours now. Any help getting me off in the right direction would be much appreciated!
 
Last edited:
Is the form opened from within the report vba module? i.e. Report_Open event

This is one way it could be being done.

Stu
 
It sounds as though the report is based on a query which uses parameters: the query will automatically prompt for parameters when it is run.

Have a look at the query design for things in []s in the criteria line(s) which are not fields from the underlying tables.

Dave
 
stubailey007 said:
Is the form opened from within the report vba module? i.e. Report_Open event

This is one way it could be being done.

Stu

Hmm, I'm not sure if I'm checking this correctly - I open the report in design view, change the view to code, and then specify 'report' in the left-hand drop-down - which gives me:

Private Sub Report_Open(Cancel As Integer)

End Sub

Not sure if I'm looking at the right code, but if so, it doesn't appear to there?
 
DaveJHPT said:
It sounds as though the report is based on a query which uses parameters: the query will automatically prompt for parameters when it is run.

Have a look at the query design for things in []s in the criteria line(s) which are not fields from the underlying tables.

Dave

Ah interesting, I've come across this type of thing in the relevant query fields:

Like [forms]![find item]![item] & "*"

So that's triggering the data entry form?

Edit: Oh, I should say, the query does ask for parameters, but the data entry form I get seems to be built on top of that.
 

Users who are viewing this thread

Back
Top Bottom