how to move a value from one form to another on click

D

Dan C

I have a long list of products in a popup form. I would like for the user to
select a product from the list and have the product number selected
automatically go to a subform which is based on a query that will bring up
the product incormation. A look up list or combo box is awkward because
there are many products and the users are inexperienced. Can the product
number be copied and pasted into the subform using a macro or VBA and an
event procedure? If so, how do I do this?
 
A

Arvin Meyer

Both a list box and a combo box can show multiple rows in Access. With an
Access list box, you can even display multiple rows and select multiple
choices.

Just use both e product number and name in 2 columns, and use the after
update event of the combo or list box to requery a subform who's
recordsource is limited by the combo. So, the subform's recordsource might
look like:

Select * From tblProducts Where ProductNumber =
Forms!MyMainFormName!cboProductNumber

Then in the afterupdate of the combo, use code like:

Sub cboMyCombo_AfterUpdate()
Me.NameOfSubformControl.Requery
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Top