filtering contents of listbox when form opens

B

BRC

I have a form with a listbox. The form is opened by a call from
another form. I would like to filter the contents of the list box with
either openargs (or something similar). I know how to pass the value
with openargs but not sure how to apply the value to filter listbox
contents. Any suggestions would be appreciated. Thanks BRC
 
D

Damon Heron

Assign the openargs value to a variable, then use the variable in a sql
string to make it the listbox's rowsource.
For example, (pseudo code)
mystr= me.openargs
strsql="Select yourfields from table where field =mystr"
me.listbox.rowsource= strsql

Damon
 
B

BRC

Assign the openargs value to a variable, then use the variable in a sql
string to make it the listbox's rowsource.
For example, (pseudo code)
mystr= me.openargs
strsql="Select yourfields from table where field =mystr"
me.listbox.rowsource= strsql

Damon






- Show quoted text -

Thanks Damon, problem solved
 

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