G
Guest
I have a combo that based on what is chosen, needs to trigger the row
source for the next combo.
The first combo is called FKPartyType and the second combo is called
cboParty.
This is the code that I have:
When I pick 1 of the values for FKPartyType combo, and go to the
cboParty combo, I get an error about the select statement. The
message details the sql that would pick the value for the right source
code.
So if the FKPartyType =2 the source of cboParty should be tblPartyA
and the SQL message I get says errors with that SQL statement. Same
thing if I chould 1 or 3. I get the other SQL statement in an error
box, that there are issues with that one. Can anyone please help me
straighten out the syntax?
Thanks!
source for the next combo.
The first combo is called FKPartyType and the second combo is called
cboParty.
This is the code that I have:
Code:
Private Sub FKPartyType_AfterUpdate()
If Me.FKPartyType = 2 Then
With Me("cboParty")
..RowSource = "Select tblPartyA.PKPartyAID,
tblPartyA.txtFirstName,tblPartyA.txtMiddleInitial,
tblPartyA.txtLastName" _
& "From tblPartyA" _
& "Where (tblPartyA.CaseID = '" & Me!FKCaseID & "') "
..RowSourceType = "Table/Query"
..BoundColumn = 1
..ColumnCount = 4
..ColumnWidths = "0in;1.0in;.05in;1.0in"
..ListRows = 8
End With
Else
With Me("cboParty")
..RowSource = "Select tblPartyB.PKCaseDefendnatID,
tblBLookup.txtBLookup" _
& "From tblPartyB" _
& "Join tblBLookup on tblPartyB.FKBLookup = tblBLookup.PKBLookupID" _
& "Where (tblPartyB.CaseID = '" & Me!FKCaseID & "') "
..RowSourceType = "Table/Query"
..BoundColumn = 1
..ColumnCount = 2
..ColumnWidths = "0in;1.0in"
..ListRows = 8
End With
End If
End Sub
When I pick 1 of the values for FKPartyType combo, and go to the
cboParty combo, I get an error about the select statement. The
message details the sql that would pick the value for the right source
code.
So if the FKPartyType =2 the source of cboParty should be tblPartyA
and the SQL message I get says errors with that SQL statement. Same
thing if I chould 1 or 3. I get the other SQL statement in an error
box, that there are issues with that one. Can anyone please help me
straighten out the syntax?
Thanks!