Opening forms w/command button

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

Guest

1. Main form opens from query prompting ID
2. Subform opens with records based on ID
3. Command button to open another form, also based on ID from Main form
Problem:
The form referred to in 3 is based on Union query which asks for ID
I don't want user to have to type in ID twice. (once to open main form) and
second time to open form initiated by command button.
 
Dar,
Change your second form to open using the ID value from the "open" first
form... not user input.

ID = Forms!frmYourFirstForm!ID

hth
Al Camp
 
I did that, and it still asks for ID a second time. (by second form, do you
mean the subform, or the form being opened by command button?)
 
Dar,
A main form, and it's subform, are usually considered "a form" unless
specifically addressing the main or the subform individually. Let's call
that Form1.
Your main form and subform should be opened by your parameter query
(asking for an ID). Once that form is opened, your second form Form2 (the
one being opened by the button) should have it's own query... that uses the
ID value from the open Form1's ID value.

The criteria in Form2's Union query would be...
ID = Forms!Form1!ID

hth
Al Camp
 
Back
Top