Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Listbox to filter form. 1

Status
Not open for further replies.

kelfuego

MIS
Jun 5, 2002
74
US
I right I'm in need of a bit of help. I am pretty weak with my vba skills and I'm hoping someone can spell out how to accomplish the task I wish to accomplish.

Here's the scenario:

I have an Access 2002 db

table = tblcustomers
CustomerNO field = primary key
Lname = field I wish to populate my list box with
MainForm = frmcustomers
list0 = my list box

Presently I have have a listbox which is unbound that I have populated using the row source field in properties. (I would prefer to learn how to do this using ADO if possible)

What I would like is to be able to do is have the end user double click a last name and pull up the matching entry in a series of textboxes off to one side (I game for either using a subform or working with the main one for this display,which ever is easier) The user will then be able to update those fields.


Any help would be greatly appreicated.



Kelly Johnson MCP
Central City Concern
 
ADO not necessary to populate ListBox.

Your listbox has a rowsource. uSe same table/query for
subform.

Your Primary key in listbox, is probably 1st column.

When selection made, filter/search subform, using PrimaryKey.

Docmd.FindRecord lstBox.Column(0)
Or Me.SubForm.Form.Filter = "PkID =" & lstBox.Column(0)
Me.SubForm.Form.FilterOn = True
 
Thank you for your help.

Kelly Johnson MCP
Central City Concern
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top