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!

Trying to load a listbox from a different form ?

Status
Not open for further replies.

gazolba

Programmer
Dec 4, 2001
167
US
I have a form with a list box and a FIND button. When this button is pressed it leads the user thru a series of other forms to select records. I build an SQL and want to load it into the rowsource of the original form.
I'm using this code but it is not finding the form.

[Forms]![frmNewTicketSubform]![lstTickets].RowSourceType = "Table/Query"
[Forms]![frmNewTicketSubform]![lstTickets].RowSource = strSQL
[Forms]![frmNewTicketSubform]![lstTickets].Requery

I get no prompts when entering this code so dont know how to find out the correct reference. MS Access help was of no help (as usual)
 
I should have mentioned the original form is a subform, so do I have to put:

{Forms]![mainform]![subform] ??
 
Try something like this:
Forms!frmMainForm!frmNewTicketSubform.Form!lstTickets.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top