BlueJacket
Registered User.
- Local time
- Today, 16:23
- Joined
- Jan 11, 2017
- Messages
- 90
I made a basic form for a County Information table.
I'm trying to use some VBA code I found (I can't post the direct link, but it's from fontstuff), so that I can perform a simple search for each county outside of the Navigation Bar. This is the code that I'm using:
Private Sub cboCountySearch_AfterUpdate()
On Error Resume Next
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "CountyID=" & Me.cboCountySearch.Value
Me.Bookmark = rst.Bookmark
End Sub
Private Sub Form_Current()
Me.cboCountySearch.Value = Me.CountyID.Value
End Sub
No Control Source. In my Row Source, I have: SELECT [County Information].CountyID FROM [County Information];
What am I doing wrong? When I use the combo box to switch counties, nothing happens. The CountyID (PK) is the name of the county itself (no duplicates since we only work within one state), instead of a number. Could that be it? Since this works within another form linked to a table that has the PK as a number.
I'm trying to use some VBA code I found (I can't post the direct link, but it's from fontstuff), so that I can perform a simple search for each county outside of the Navigation Bar. This is the code that I'm using:
Private Sub cboCountySearch_AfterUpdate()
On Error Resume Next
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "CountyID=" & Me.cboCountySearch.Value
Me.Bookmark = rst.Bookmark
End Sub
Private Sub Form_Current()
Me.cboCountySearch.Value = Me.CountyID.Value
End Sub
No Control Source. In my Row Source, I have: SELECT [County Information].CountyID FROM [County Information];
What am I doing wrong? When I use the combo box to switch counties, nothing happens. The CountyID (PK) is the name of the county itself (no duplicates since we only work within one state), instead of a number. Could that be it? Since this works within another form linked to a table that has the PK as a number.