Hi,
I have a beforeupdate evbent that tests to see that a customer chosen
before the user can enter an amount. If the customer has not been
chosen yet, then I would like to popup a message informing the user to
first choose a customer. After the user has clicked on OK, I want the
code to undo the amount field and set focus to a field in a subform
where the user can then type in a customer nasme. Using the code below,
I get the 2108 error. Here is part of the code in the Beforeupdate
event:
'Verify that an account has been choosen
If Me.iAccountID < 1 Then
sMsg = "You must first choose an account/customer before entering an
amount"
MsgBox sMsg, vbOKOnly
Cancel = True
SendKeys "{ESC}", True
SendKeys "{ESC}", True
Me.cServiceAmount.Undo
Me.WorkOrderEditSFService.SetFocus
Me!WorkOrderEditSFService.Form!fsContact.SetFocus
Exit Sub
End If
I get th error on the first setfocus statement. As you can see I've
tried using both the undo command and the sendkeys event. I've tried
all combinations of these statements but still get the error 2108 each
time.
Thanks for any help in advance,
Adolph