Filtering Form

K

Kevin Sprinkel

I have a form, call it Form1, that I'm using to set
filtering criteria and initial values for Form2. Form2 is
a based on a Job table, with a multi-record detail subform
linked on the job number.

Form1 has the following controls:

cboJobNumber Multi-column query into Job table
Other textboxes Display other cbo columns as confirmation
that user has selected right record
InitialReference Initial default value for a control in
Form2

A command button on Form1 opens Form2, matching the Job
number from the Form1 combo box. This works fine.

The Default Value property for a control in Form2 has been
saved with the value:

Forms!frmForm1!txtInitialReference

It is properly getting the value from the Form1 control.

What I'd like to happen is either for the initial form to
close after opening Form2, or have them both close when I
close Form2.

As it is now, if I close Form1, Form2 won't have an
initial default value, and I don't know how, and have
failed in the On Close and On Deactivate events of Form2
to close Form1.

Can anyone resolve this problem?

Thank you.

Kevin Sprinkel
 
G

Gerald Stanley

Try placing the following lines after the DoCmd.OpenForm
statement in your command button's click event handler

Forms!Form2.{your control}.DefaultValue = txtInitialReference
DoCmd.Close acForm,Me.Name

Hope This Helps
Gerald Stanley MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top