I am new for VBA code.
I copied a cascade listing code from internet and revise to fit my program. If I select a region, then the Agency under that region will show up. I still need an extra where statement : Note = "SC". I tried several time and always get error, can somebody help me add the statement?
Many Many thanks.
I copied a cascade listing code from internet and revise to fit my program. If I select a region, then the Agency under that region will show up. I still need an extra where statement : Note = "SC". I tried several time and always get error, can somebody help me add the statement?
Many Many thanks.
Code:
Private Sub Region_AfterUpdate()
On Error Resume Next
SCAgency.RowSource = "Select tblProvAgency.Agency " & _
"FROM tblProvAgency " & _
"WHERE tblProvAgency.Region = '" & Region.Value & "' " & _
"ORDER BY tblProvAgency.Id;"
End Sub