skilche1
Registered User.
- Local time
- Today, 10:51
- Joined
- Apr 29, 2003
- Messages
- 226
I am trying to get get 2 comboxes to refresh from one when cascading. The first combobox (Location) works, but the second one (Catches) doesn't. All I get are the Key values of the catches rather than the values...
I am wondering if it my relationship set up of if my VBA needs to be altered to accommodate the requering the two comboboxes.
Can anyone assist?
Thanks
VBA
I am wondering if it my relationship set up of if my VBA needs to be altered to accommodate the requering the two comboboxes.
Can anyone assist?
Thanks
VBA
Code:
Private Sub cboCategory_AfterUpdate()
Dim sCatchLocation As String
Dim sCatch As String
sCatchLocation = "SELECT [tblLocation].[Location_ID], [tblLocation].[LocationCategory_ID], [tblLocation].[Location] " & _
"FROM tblLocation " & _
"WHERE [tblLocation].[LocationCategory_ID] = " & Me.cboCategory.Value
Me.cboLocation.RowSource = sCatchLocation
Me.cboLocation.Requery
Me.Refresh
'Seperation from Location
sCatch = "SELECT [tblCatch].[Catch_ID], [tblCatch].[LocationCategory_ID], [tblCatch].[Catch] " & _
"FROM tblCatch " & _
"WHERE [tblCatch].[LocationCategory_ID] = " & Me.cboCategory.Value
Me.CboCatches.RowSource = sCatch
Me.CboCatches.Requery
'Me.cboCatches.Visible = False
Me.Refresh
End Sub