If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Field required only if visible
Hi there,
I'm trying to wrap my head around something and am wondering if any of you marvelous guys could help me! I have a combo box and I've coded it so that if a certain value is selected (the value is "sent to scope"), a text box becomes visible so that the user can enter a date (we'll call the value "date to scope"). Is there a possible way to make it so that the Date to Scope field is a required field but ONLY if it is visible? Thanks so much! |
#2
|
|||
|
|||
Field required only if visible
"Bellyjeans" wrote in message
... Hi there, I'm trying to wrap my head around something and am wondering if any of you marvelous guys could help me! I have a combo box and I've coded it so that if a certain value is selected (the value is "sent to scope"), a text box becomes visible so that the user can enter a date (we'll call the value "date to scope"). Is there a possible way to make it so that the Date to Scope field is a required field but ONLY if it is visible? You'd have to do this with code in the form's BeforeUpdate event. Something like this: '----- start of example code ----- Private Sub Form_BeforeUpdate(Cancel As Integer) With Me![Date to Scope] If .Visible Then If IsNull(.Value) Then Cancel = True .SetFocus MsgBox _ "Please enter the Date to Scope.", _ vbExclamation, _ "Value Required" End If End If End With End Sub '----- end of example code ----- -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|