By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

sending data from popup to main form

P: n/a
I have an app which handles data relating to cattle.
The ear tag number consists of 3 parts. Country code - UK. Farm Code - 107248.
and animal number - 600555.

At present the complete set has to be entered for each animal. I am going to
store the first 2 parts. then when the user tabs into the tagno control a pop up
form has the defaults already there with just the animal number to enter.

The question is how best to gather the 3 parts from the pop up and squirt them
into the tagno of the main form
TIA
David B

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
When I use pop-up forms, I like them to be completely modal - including
suspending all program flow until it has been dealt with. With a little
creativity, the DoCmd.OpenForm allows you to do this.

In the event that the pop-up is opened in use this code

DoCmd.OpenForm 'FormName',acViewNormal,,,,acDialogue, 'Open Argument string'
Select Case SysCmd(acSysCmdGetObjectState,acForm,'FormName')
Case acObjStateOpen
'Form is open but is not visible.
'Add code to reference the controls on it and get the values you
need
Case 0
'Form is closed, do nothing as it was canceled
Case Else
'Form has been put into some mode not anticipated. Handle here
End Select
Use the pop-up's OnLoad event to get whatever defaults you want. I usually
provide an Ok/Cancel set of buttons. Code the buttons to do this..

OK - Me.Visible = False

Cancel - DoCmd.Close

This allows the popup form code to run, while the main form waits for it to
finish before it continues. I do believe even menus are not active during
this.
Once your main form is done getting the data you want, remember to close the
popup form or it will stay open and invisible.

Mike Storr
www.veraccess.com

"David B" <da***@marleycotenospam.fsnet.co.uk> wrote in message
news:bu**********@newsg4.svr.pol.co.uk...
I have an app which handles data relating to cattle.
The ear tag number consists of 3 parts. Country code - UK. Farm Code - 107248. and animal number - 600555.

At present the complete set has to be entered for each animal. I am going to store the first 2 parts. then when the user tabs into the tagno control a pop up form has the defaults already there with just the animal number to enter.

The question is how best to gather the 3 parts from the pop up and squirt them into the tagno of the main form
TIA
David B

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.