Enforcing "required" on a control/textbox

  • Thread starter Thread starter Peter
  • Start date Start date
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!
 
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
 
Back
Top