[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Reference field on popup form

Posted on 2011-02-11
5
Medium Priority
?
238 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 500 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

834 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