Enforcing "required" on a control/textbox

P

Peter

Hi again...i am trying to solve the following problem...

Private Sub Type_AfterUpdate()
If Me.SomeOtherControl.Visible = True


"SomeOtherControl" does not have the "required" status and i dont want it to
have it in the table..how do i make it "required" with code in this case...

i.e words..when the textbox becomes visible..you have to populate it...

does it makes sence...?

Cheers!
 
J

John W. Vinson

Hi again...i am trying to solve the following problem...

Private Sub Type_AfterUpdate()
If Me.SomeOtherControl.Visible = True


"SomeOtherControl" does not have the "required" status and i dont want it to
have it in the table..how do i make it "required" with code in this case...

i.e words..when the textbox becomes visible..you have to populate it...

does it makes sence...?

Cheers!

Use the Form's BeforeUpdate event to check for the combination:

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Me!Type = "yadda yadda yadda" Then
If IsNull(Me!SomeOtherControl) Then
MsgBox "If Type is yadda you must fill in SomeOtherControl", vbOKOnly
Cancel = True
End If
End If
End Sub
 
P

Peter

Hi John and thanks for your reply, this will make wonders to my small
application!
 

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