Pop up selection to form field


J

Jeremy Hatcher

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/tutorial...d8-3e2773fa29b5/whats-new-for-developers.aspx
 
Ad

Advertisements

J

Jeanette Cunningham

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top