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!

Enter parameter value

Status
Not open for further replies.

joeblow3

Programmer
Jun 9, 2008
21
CA
Hi:

My setup is as follows:

I have a Main form which has a listbox (List33) from which I (on selection of an item) want to populate another listbox (List11) on a sub-form of a sub-form of the main form.

My code on the main form is:

Private Sub List33_AfterUpdate()
Dim stDocName As String
stDocName = "Query2"

Me![sub Participant_line].Form![sub Response].Form!List11.RowSource = stDocName


End Sub


and my query(Query2) has a "which" part of the sql as:

[Me].[Parent].[Parent]![List33]![Column(0)]


However, When I click the item in Listbox, List33, I keep getting the "Enter Parameter Value" Message box popping up.How please can I fix the problem.

Thanks in advance.

 
A query can't have a criteria like:
[Me].[Parent].[Parent]![List33]![Column(0)]
A query has no "me" or parents. You would need to substitute the name of the form. You can also ommit the Column(0) since normally only the bound column can be used in a criteria.

Duane
Hook'D on Access
MS Access MVP
 
First your code will be on the OnClick event of the firt listbox.

Your criteria (not "which") for your query would look like:
[Forms]![Formname]![list33]
Change Formname to your form's name.

An SQL example:
SELECT Customer_Table.CustID, Customer_Table.lname
FROM Customer_Table
WHERE (((Customer_Table.lname)=[Forms]![listbox_test]![list0]));
 
Thanks a lot to both of you guys. I got it to work by putting in the form name, omitting the 'Column(0)', and putting it in my click event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top