Hello Friends,
I have a bound form that I set to open without a record showing. I usually select the record from a combo box. However, I can't figure out why this code I've used many times before will not work on this form.
Private Sub cboUnitID_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Dim strComboVar As String
strComboVar = Me.cboUnitID
Debug.Print strComboVar
Debug.Print Len(cboUnitID & vbNullString)
If Len(cboUnitID & vbNullString) < 0 Then
Me.Filter = ""
Me.FilterOn = False
DoEvents
Set rs = Me.Recordset
rs.FindFirst "[BOMID] = '" & strComboVar & "'"
If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
Set rs = Nothing
End If
End Sub
The form stays filtered at the bottom and I get the correct value and length in the immmediate window when I'm troubleshooting. Could I be missing a reference or something? Nothing appears to happen when I run the code except for what shows up in the immediate window.
Doyce
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar