validationrule is not wakeup just in time

G

Guest

hi
- my interest table field "pmaterial" default value "null"

- validationrule "is not null" for this field in form
- validationtext "This field can't null please ...."
- but this rule is not run for as above field first time and cursor jumped
other field. but when input data in filed and after deleted and after press
tab this rule run.

what can i do

melih kular
 
A

Allen Browne

As you found, the Validation Rule for the text box is not fired if the user
doesn't do anything with the text box.

If you want to rule to *always* be applied to the field, remove it from the
text box in your form, and put it into the Validation Rule for the field in
the table (lower pane in table design view), or just set the field's
Required property to Yes.

If you want to do it through the form, use the BeforeUpdate event procedure
of the *form* instead of the text box:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.pmaterial) Then
Cancel = True
MsgBox "Enter pmaterial, or press <Esc> to undo entry."
Me.pmaterial.SetFovus
End If
End Sub
 
K

Kenan Beshir

how do you open the main form from the login form, but then close the login
form


dim x as new mainMdi
x.show
that the code for showing the new form
but for closing the login form
me.close

closes the whole application
this example is in vb.net

mail to:[email protected]
 

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

Top