Form and Subform must enter query info twice

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a form with a subform. They are both based on the same query, which asks for info to be entered prior to opening the form.

When I try to open the form, the data entry box opens. I then enter the requested data, press Enter and it then asks for
the info again. Once I enter it again, the form & subform opens and displays the proper data.

If I enter the info the first time it asks, and leave the second time blank, It gives me just the info on the main form and leaves the subform blank.

If I leave the first time blank and enter the info on the second time it asks, then the main form is blank and the subform displays the info.

I think it might have something to do with the child / master relationship, but I haven't been able to find a salution.

Any help would be appreciated,

Jesse
 
Base the subform on a saved query that is the same as your parameter
query, but does not have the WHERE with the parameter. Leave your main
form as a parameter query.
When you open the main form and enter the parameter, the subform will
open without the prompt using the full query but will be filtered using
the Parent-Child relationship.

Good luck,
Pavel
 
I have created a form with a subform. They are both based on the same query, which asks for info to be entered prior to opening the form.

Ummm... this is a bit odd. If you're planning to edit data, the form
and the subform will interfere with one another.
When I try to open the form, the data entry box opens. I then enter the requested data, press Enter and it then asks for
the info again. Once I enter it again, the form & subform opens and displays the proper data.

If I enter the info the first time it asks, and leave the second time blank, It gives me just the info on the main form and leaves the subform blank.

If I leave the first time blank and enter the info on the second time it asks, then the main form is blank and the subform displays the info.

Exactly. You're getting what you ask for: the blank criteria will
return no records.
I think it might have something to do with the child / master relationship, but I haven't been able to find a salution.

Let's step back a bit and identify the PROBLEM! What do you intend as
the function of this form?
 
The query asks for a department name.
The main form displays the requested department name,
address, etc...
The subform displays a listing of all of the equipment
assigned to the requested department.

Jesse
-----Original Message-----
based on the same query, which asks for info to be entered
prior to opening the form.
Ummm... this is a bit odd. If you're planning to edit data, the form
and the subform will interfere with one another.
I then enter the requested data, press Enter and it then
asks forthe second time blank, It gives me just the info on the
main form and leaves the subform blank.the second time it asks, then the main form is blank and
the subform displays the info.
Exactly. You're getting what you ask for: the blank criteria will
return no records.
master relationship, but I haven't been able to find a
salution.
 
This sounds feasable. But I need some clarification.
Are you saying for me to create another parameter query
for the subform? And what is the "Where" that you refer
to? And last, How should the parent/child relationship be
set up? Currently these are blank.

Jesse
-----Original Message-----
Base the subform on a saved query that is the same as your parameter
query, but does not have the WHERE with the parameter. Leave your main
form as a parameter query.
When you open the main form and enter the parameter, the subform will
open without the prompt using the full query but will be filtered using
the Parent-Child relationship.

Good luck,
Pavel
based on the same query, which asks for info to be entered
prior to opening the form.I then enter the requested data, press Enter and it then
asks forthe second time blank, It gives me just the info on the
main form and leaves the subform blank.the second time it asks, then the main form is blank and
the subform displays the info.master relationship, but I haven't been able to find a
salution.
 
The query asks for a department name.
The main form displays the requested department name,
address, etc...
The subform displays a listing of all of the equipment
assigned to the requested department.

Why not base the Form on the Department table, and the Subform on the
Equipment table, using the DepartmentID as the master/child link
field?
 
If I base the forms on tables, then how do I get the form
to ask for the department name? Can this be done without
using a query to ask the question and then do the search?

Jesse
 
If I base the forms on tables, then how do I get the form
to ask for the department name? Can this be done without
using a query to ask the question and then do the search?

ummm... what objection do you have to queries? No Access application
can function without queries!!!

You can put an unbound Combo Box on the form to select a desired
department. The Combo Wizard will walk you through this, or it's
pretty easy to do without the wizard; post back if you need help.
 
Back
Top