Two List Boxes Problem

gbil

Registered User.
Local time
Yesterday, 18:17
Joined
Aug 30, 2013
Messages
26
hello again.

i'm trying to set my main form, with 2 list boxes. the first is list of organizations and the other is supposed to show list of members of that organization.

i have this code to run in the click event in the first list:

Private Sub lstOrg_Click()

Me.lstMembers.RowSourceType = "Table/Query"
Me.lstMembers.RowSourceType = "SELECT tblMembers.tFName, tblMembers.tMName, tblMembers.tLName FROM tblMembers Where tOrgCode = '" & Me.lstOrg & "'"


End Sub

but this code does not show anything on the second list, just 3 dividers and no more.

when i watch tOrgCode (of WHERE clause) the watch window says: tOrgCode : <Expression not defined in context> : Empty : Form_frmMain.lstOrg_Click

what could be wrong wrong?

attached is the stripped DB in 2000 - 2003 version.

please note that i am not selling any program. this is for our organization which non-profit and non-stock.

thank you.
 

Attachments

Both lines say *RowSourceType*. The one with the SQL should say *RowSource*

Code:
Me.lstMembers.RowSourceType = "Table/Query"
Me.lstMembers.RowSource = "SELECT tblMembers.tFName, tblMembers.tMName, tblMembers.tLName FROM tblMembers Where tOrgCode = '" & Me.lstOrg & "'"
 
oh. thank u Gina.

it works now perfectly. great!!

:)
 

Users who are viewing this thread

Back
Top Bottom