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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting listboxes (easy question)

Status
Not open for further replies.

Sadukar

Technical User
Feb 19, 2003
159
IE
Hi all,

I havent messed around in access in a while and I think I am bit rusty.

Anyway, I have a button that filters a list box. This is fine to do except when I have to do it from another form.
For Example:
Dim strDept As String
Dim lst As ListBox
Set lst = Form.frmMain.List22 (problem)

strDept = "whatever"
lst.RowSource = strDept

Where the above code is in frmOperator and the list box is in form Main.

I cant remeber how to set the listbox to a different form that is open. A bit of help please!!!

Thaks,
S
 
Hi!

Try:
[tt]Set lst = Form!frmMain!List22[/tt]

Roy-Vidar
 
Thanks Roy

Does not work though.

When I debug and hold cursor over I get the message
Form!FrmMaim!List22 <microsoft access cannot find the field 'FrmMain' refer...

Any more sugestions?
 
Goofed up a bit (typo), it's Forms (plural)

[tt]Set lst = Forms!frmMain!List22[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top