MikeAngelastro
Registered User.
- Local time
- Today, 10:01
- Joined
- Mar 3, 2000
- Messages
- 254
Hi,
I have a form containing a text box. People enter data to it and then tab out of it. I check it and if there is no problem the program does other things. If there is a problem, I alert the user with a message box and return focus to the original text box. I want the entire contents of the text box to be highlighted at this time. However, the cursor just positions itself in front of the first character. My code follows:
Private Sub InvoiceNo_AfterUpdate()
If Not InvoicePosted(Me.Invoice_Number) Then
Do stuff
Else
MsgBox "This invoice has aready been posted. Either unpost it or select another invoice."
Me.InvoiceNo.SetFocus
Me.InvoiceNo.SelStart = 0
Me.InvoiceNo.SelLength = Len(Me.InvoiceNo.text)
End If
I'm using Access 2002. Any ideas?
Thanks,
Mike
I have a form containing a text box. People enter data to it and then tab out of it. I check it and if there is no problem the program does other things. If there is a problem, I alert the user with a message box and return focus to the original text box. I want the entire contents of the text box to be highlighted at this time. However, the cursor just positions itself in front of the first character. My code follows:
Private Sub InvoiceNo_AfterUpdate()
If Not InvoicePosted(Me.Invoice_Number) Then
Do stuff
Else
MsgBox "This invoice has aready been posted. Either unpost it or select another invoice."
Me.InvoiceNo.SetFocus
Me.InvoiceNo.SelStart = 0
Me.InvoiceNo.SelLength = Len(Me.InvoiceNo.text)
End If
I'm using Access 2002. Any ideas?
Thanks,
Mike