Open pop up form problem

G

Guest

I am running Access 2003 SP3 on Win Vista Home Premium SP1.
My DB design: t_Main, linked by one-to-many relationship to tables
t_products and t_requests using the custID field in t_Main.
f_Main has two command bottoms to open f_products and f_requests.
I need to create a new customer, and pop open the products or requests
forms to add information there to that particular customer.
The problem is the unless I manually insert the custID into the other
two tables-forms, my data will not be saved.
How can I pop open the -say- requests form and fill data in there to the
relevant customer without manually having to type the custID.

Thanks
 
A

Arvin Meyer [MVP]

If you have a bound, linked subform, the data will automatically fill the
linked field. Use the subform wizard to build it, if you aren't sure what to
do.
 
T

Tom van Stiphout

On Thu, 29 Jan 2009 15:00:07 +0200, no_spam

The classic solution is not to use popups but use subforms. If you
link them properly via the LinkMasterFields and LinkChildFields, the
foreign key value will be entered automatically.

If you insist on using a popup form, pass in that value, via the
OpenArgs argument of DoCmd.OpenForm:
DoCmd.OpenForm FormName:="myPopupForm", OpenArgs:=Me.CustID
Then in the receiving form you can use OpenArgs to set the value of
the FK field in Form_Load:
Me.custID = OpenArgs

-Tom.
Microsoft Access MVP
 
G

Guest

Thanks for the responses, I have to use the pop up form format because
the main form contains lots of information that adding another subform
in the screen space would be too cluttered, I will try Tom's solution
and come back if any problems arise.
 
B

bazilthebest

Before opening the popup use a gotonextrecord followed by a
gotopreviousrecord. This causes the data on the main form to be saved but
leaves you on the new customer record.
 

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