Link to home
Start Free TrialLog in
Avatar of ExpressMan1
ExpressMan1Flag for Canada

asked on

Combo Box on subform not updating for certain records unless selected twice.

Small DB example attached.

Combo box on subform updates records in conjuction  records in main form "frmInvoice" except for the  last record in combo box "222211111242"
If record "222211111242" is chosen for a second time it updates to the correct record.

Tried Me.Combo15.Requery in various places but not working.

Private Sub Combo15_AfterUpdate()
 
    Me.RecordsetClone.FindFirst "[ShipmentID] = " & Me![Combo15]
    If Not Me.RecordsetClone.NoMatch Then
        Me.Bookmark = Me.RecordsetClone.Bookmark
        Else
        Me.Parent.RecordsetClone.FindFirst "[InvoiceNumber] = " & Me.Combo15.Column(1)
            If Not Me.Parent.RecordsetClone.NoMatch Then
                Me.Parent.Bookmark = Me.Parent.RecordsetClone.Bookmark
                Else
                MsgBox "Record Not found!"
            End If
    End If

End Sub
Invoice-Rev1.zip
SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ExpressMan1

ASKER

Both work great. Thank You Rey and Gustav.

Thanks again to Rey as it was his original code I was using. Interesting how this unusual problem can be solved two totally different ways.