listbox rowsource-sql references textbox on same form

W

WebDude

Its late, im just going to shoot this out...

When Button1 on form1 is pressed it opens form2 and puts a number into
textbox2 of form2.. works fine.. but then listbox2 on form2 is supposed to
populate using the value in textbox2 as one of its criteria in its rowsources
sql.

So, i put me.listbox2.requery and me.form.refresh and me.form.requery
everywhere i can.. but the only way listbox2 populates is when i view form2
in design view and then switch back to form view.

any ideas?
cheers
webdude
 
W

WebDude

Webdude..
we meet again..
for the first time.

:-|


Ive discovered how to solve the problem which arose
on your forms hours ago. It merely requires
inserting a simple line of code to the button on
form1....I assume, of course, that the code for that
button goes something like this;

DoCmd.OpenForm "form2",,,
Forms!form2.textbox2 = me.txtbox1

After which just add the following;
Forms!Form2!listbox2.requery


Until iiiiii'm needed again,
wb
 
D

david epsom dot com dot au

v = me.mylistbox.listcount

If that doesn't work then

me.mylistbox.rowsource = me.mylistbox.rowsource

(david)
 

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

Similar Threads


Top