Force field to update

Eikenhorst

Registered User.
Local time
Today, 17:51
Joined
Mar 9, 2007
Messages
25
Hello,

I have a problem with updating of a field. I have made a form where you can only navigate through the different fields by using the Enter or Tab key with a KeyDown event on every field. This event checks if the typed data is correct and if it is then unlocks the next field and moves the focus to this new field and locks the previous. (I have set the tap stop property to No in all fields to make this possible)

The problem is that if I want to check if there is anything typed in a textbox with the following code:
If IsNull(Me.Text1)=True Then
MsgBox “You’ll have to fill something in this textbox”
End if
When I type something into this textbox and then press enter it should not give this message, but it does! I have noticed that it doesn’t save the information while typing information in this textbox. So when I press enter it still thinks it is empty. When I click away this message and try it again, then it is updated and I don’t get this message again and it works fine.

So what I want is some method that updates the information in this field before its content is being checked. Unfortunately Me.Text1.Update doesn’t work. Is there a way that I can fix this problem?

Any help is greatly appreciated, it has cost me a lot of time to make this form work this way and my manager needs it to work this way. :(
 
Sorry, I just saw a solution for my problem

By ussing the next code as first in every KeyDown event the information in all the fields on my form is updated:
If KeyCode = vbKeyReturn Or KeyCode = vbKeyTab Then
Me.Refresh
End if

Thanks for your attention! :)
 

Users who are viewing this thread

Back
Top Bottom