AutoSkip

A

Anna

Can any one please help me why it dont works?

Private Sub Date1_KeyPress(KeyAscii As Integer)
If Len(Nz(Me.Date1, "")) = 6 Then
Me.Date2.SetFocus
End If

End Sub

Thank You.
 
B

BruceM

Two possibilities occur to me. One, why the KeyPress event? That is a
rather specialized event, which may be different from what you expect. What
would you like to have happen? Two, if a control and a field have the same
name (e.g. if Date2 is both the field and the text box name) you could have
difficulties. If so, try changing the name of the text box to txtDate1 or
something like that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Cancel Update 1
Userform help 5
Formatting a Date field into a form????? 4
Userform Help!! 1
Problem with KeyPress Event 2
Field Required msg 2
Reference Label from TextBox 7
Sub form combo issue 2

Top