Pete Morris
Registered User.
- Local time
- Today, 11:29
- Joined
- Mar 31, 2003
- Messages
- 38
Hi,
I am trying to get this code to work for cascading combo boxes on a form, but keep getting the above error.
Could someone look at the code and let me know what obvious bit I'm missing.
I'm new to code and have hashed this from an example to try to get it to work on my database.
Also would this work if there was also a not in list event procedure on the same cbobox
Private Sub ClientName_AfterUpdate()
Dim cboProjectCode As AccessObject
Dim cboClientName As AccessObject
'cascading cbo to align the users choices against relevant items available
With cboProjectCode
Set cboProjectCode.RowSource = "Select tblClientNameLookup.ClientName " & _
"FROM tblClientNameLookup " & _
"WHERE tblClientNameLookup.ClientName = '" & cboClientName.Value & "' " & _
"ORDER BY tblClientNameLookup.ProjectCode;"
End With
End Sub
Thanks in hope,
Pete.
I am trying to get this code to work for cascading combo boxes on a form, but keep getting the above error.
Could someone look at the code and let me know what obvious bit I'm missing.
I'm new to code and have hashed this from an example to try to get it to work on my database.
Also would this work if there was also a not in list event procedure on the same cbobox
Private Sub ClientName_AfterUpdate()
Dim cboProjectCode As AccessObject
Dim cboClientName As AccessObject
'cascading cbo to align the users choices against relevant items available
With cboProjectCode
Set cboProjectCode.RowSource = "Select tblClientNameLookup.ClientName " & _
"FROM tblClientNameLookup " & _
"WHERE tblClientNameLookup.ClientName = '" & cboClientName.Value & "' " & _
"ORDER BY tblClientNameLookup.ProjectCode;"
End With
End Sub
Thanks in hope,
Pete.