Required data

robinski

New member
Local time
Today, 23:04
Joined
Oct 21, 2001
Messages
6
Greetings,

I have a text field which is a required field.

It is marked 'required' in the table properties. This causes the error message to appear when attempting to leave the record. I need the error message to appear when leaving the field. I have read the 'help'
explanation but cannot understand what they are trying to tell me.

Your ideas will be appreciated.

robinski
 
you can try this on the Lost Focus Event

If IsNull(Me.TextBox) Then
MsgBox "Need To enter Data Here in this field",, "Need Data"
Me.TextBox.SetFocus
End If

This will check if there is data in that required field once it has left lost focus on that field. This Will not on the other had check vor validation of the data. But you can probally work that in with more code.
HTH
 
Thanks guys, this is my first query. Is it usual to acknowledge the help? Is it OK to send an email direct with "Thank You" ?

I do understand you do not wany questions direct.

Cheers,

Robinski
 
I have now added your suggested code to the application and it works as I had hoped with the exception that I would prefer the focus to return to the original field.

Thanks

robinski
 
If you want to place the cursor at a specific field on a form, try Me.[MyField].SetFocus

HTH
Steve
 
Maybe my version of access, but I could never get Me.[MyField].SetFocus to work, but MyField.SetFocus does.
HTH
 
I am still getting the cursor go to the [Analysis] field but then go straight to the next field in the tab list.

Thanks,

robinski
 

Users who are viewing this thread

Back
Top Bottom