Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Access VBA Can't set focus

Hi

In my Access VBA I run the following code behind a Combo Box and I get the error
"Can't set focus to Customer_Code"
What am I doing wrong?

Private Sub xcmbCustomer_AfterUpdate()

On Error GoTo EH
    '-----------------------------
    Dim oCustomerCode As String
    
    DoCmd.SetWarnings (False)
    
    oCustomerCode = Me.xcmbCustomer.Text
    Me.Customer_Code.SetFocus
    Me.Customer_Code.Text = oCustomerCode
    Call oInsert_New_Invoice_Number 'eg 2018-001
    
    DoCmd.SetWarnings (True)
    '-----------------------------
    Exit Sub
EH:
    MsgBox Err.Description
    
End Sub

Open in new window

Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Is the control Customer_Code enabled?
SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan 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
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
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
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 Murray Brown

ASKER

Thanks very much