A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Pop up selection to form field



 
 
Thread Tools Display Modes
  #1  
Old February 28th, 2010, 09:09 PM posted to microsoft.public.access.forms
Jeremy Hatcher
external usenet poster
 
Posts: 1
Default Pop up selection to form field

I have a form. In that form, I have a popup button that displays a list. What I want to do is link that list to a field on the form. ie. someone selects a name from the popup list, the popup closes and the item that was clicked, is inserted in the field.

I am very new at this and find it a bit of a challenge.

Thanks

Jeremy


Submitted via EggHeadCafe - Software Developer Portal of Choice
What's New for Developers in SharePoint 2010 Object Model?
http://www.eggheadcafe.com/tutorials...evelopers.aspx
  #2  
Old February 28th, 2010, 09:44 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Pop up selection to form field

Try it like this

In the after update event for the popup list

Private Sub [PopupListName]_AfterUpdate()
If Not IsNull(Me.PopupListName) Then
Forms!MainFormName.[NameOfTheControl] = Me.PopupListName
DoCmd.Close acForm, Me.Name
End If
End Sub

The above may need some adjustments to work for your forms.

Replace PopupListName with the name of your popup list.
Replace MainFormName and NameOfTheControl with the names of your forms and
controls.

The square brackets [] are only needed around names for fields and controls
that have spaces in them.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



Jeremy Hatcher wrote in message
...
I have a form. In that form, I have a popup button that displays a list.
What I want to do is link that list to a field on the form. ie. someone
selects a name from the popup list, the popup closes and the item that was
clicked, is inserted in the field.

I am very new at this and find it a bit of a challenge.

Thanks

Jeremy


Submitted via EggHeadCafe - Software Developer Portal of Choice
What's New for Developers in SharePoint 2010 Object Model?
http://www.eggheadcafe.com/tutorials...evelopers.aspx



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.