troubleshooting Question

Access unbound combo box used to select record to display

Avatar of billious01
billious01 asked on
Microsoft Access
3 Comments1 Solution227 ViewsLast Modified:
I have a form that displays records  and allows updates based on clicking an item in an unbound combo list that displays the record keys.
This is working fine but evry time i try to add a new record the current record seems to move back to the initial record that was displayed when i try to focus on a blank field in the form.
How do I stop this happening?

Below is the code I am using:-
Private Sub Combo6_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[House Code] = '" & Me![Combo6] & "'"
    Me.Bookmark = rs.Bookmark
End Sub

Private Sub Form_Current()
     Combo6 = [House Code]
End Sub

Private Sub Add_Click()
On Error GoTo Err_Add_Click

    DoCmd.GoToRecord , , acNewRec

    Exit Sub

    MsgBox Err.Description
    Resume Exit_Add_Click
End Sub

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros