Solved

Reference field on popup form

Posted on 2011-02-11
5
224 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now