Rabu, 11 Desember 2019

[MSAccessProfessionals] Combo box lookup won't let me go back to a record previously looked up

Hello friends!

 

Access 2016. I’ve just created a form that is bound to an SQL table. I have a combo box that I use to search the table for a specific record. I have noticed that once I have searched for a record, lets say ID 5, if I try to lookup ID 5 again, it won’t pull up the record. Instead it goes to the first record in the table. If I close and reopen the form, it works again 1 time. Here is the code behind the afterupdate event on the combo box:

' Find the record that matches the control.

    Dim rs As DAO.Recordset

    Dim strComboVar As String

 

    strComboVar = txtTagNo

    If Len(txtTagNo & vbNullString) <> 0 Then

        Me.Filter = ""

        Me.FilterOn = False

        Me.Recordset.FindFirst "[TAGNUM_34]='" & strComboVar & "'"

 

    End If

 

I’ve used this code many times with Access tables. This is the first time I’ve used it with an SQL table. Is there something about an SQL table that won’t let me look up a record more than once without closing the form and reopening it? I’ve tried requerying the form and the combo box. That doesn’t work. I am updating fields in the table on the form. Could that be part of the problem?

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPOLogistics

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

 

Tidak ada komentar:

Posting Komentar