Solved

Reference field on popup form

Posted on 2011-02-11
5
226 Views
Last Modified: 2012-06-21
i have a pop up form that contains a listbox with names  how do i reference the selection the user makes back in my main form
0
Comment
Question by:ChuckRush
  • 3
  • 2
5 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 125 total points
ID: 34873538
If you are using a popup form then nothing can access data on it because no code elsewhere can run until the popup form closes.
So you have to use code in the popup form to place the value where you want it.

So in the form_close event procedure of the popup you can do something like:

forms!mainformname!controlname= me.listboxname
0
 

Author Comment

by:ChuckRush
ID: 34874117
I was afrtaid of that. I wanted to use the popup window for several fields that reference that same data.  The Main form has several fields that contain an EmplID and i am showing an alphabetical list in the popup to allow a search on last name

Any ideas?
0
 

Author Comment

by:ChuckRush
ID: 34874980
OK the POPup works now wheni explicitily reference the ctl in the parent form. Is there a way that i can capture the current ctl i am on and pass it to the popup and use that to update the form in the parent after the selection?
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 125 total points
ID: 34877441
In the openform command you can pass the name in the Openargs parameter.

docmd.OpenForm "formname", ,,,,acDialog,"callingcontrolname"

Then when you pass the chosen value back you can use the controlname..

forms!mainformname.controls("callingcontrolname") = me.listboxname
0
 

Author Closing Comment

by:ChuckRush
ID: 34889390
Thanks Peter
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question