[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Reference field on popup form

Posted on 2011-02-11
5
Medium Priority
?
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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…

649 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