Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: If field 1 is Yes, then field 2 must have comment

Results 1 to 3 of 3
Share This Thread →
  1. #1
    robmeng is offline Contributing User
    Join Date
    Nov 2004
    Posts
    32
    Rep Power
    10

    Angry If field 1 is Yes, then field 2 must have comment

    I just can't figure this out..I have two fields in my database that I want to be able to have a regulation that if the user Enter Yes to field1 than they MUST enter some comment on field2. They can't skip it. However, Field1=No, they can skip field2..Is this possible? is this have something to do data validation? Please help..thanks in advance..

  2. #2
    evansc is offline Contributing User
    Join Date
    Jul 2004
    Posts
    258
    Rep Power
    10
    Yes, you can do this - the trick is just finding the right "event" to put it on.

    on the design view of your form, open the properties dialog box.

    Go to the Event Tab.

    I'm pretty sure what you want it the "before update" event.

    Click on that option and when you see the three dots, click on them.

    Here you will put:

    Code:
    If Not(IsNull(Me.nameOfControl1)) Then
          If IsNull(Me.nameOfControl1) Then
              MsgBox "You must enter a value in control2.", vbOkOnly
              DoCmd.CancelEvent
          End If
    End If

  3. #3
    robmeng is offline Contributing User
    Join Date
    Nov 2004
    Posts
    32
    Rep Power
    10

    Thumbs up thanks

    Thanks Evansc..
    I'll try this out today..Again Thanks

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Auto Numbering
    By woodstockjs in forum Microsoft Access Help
    Replies: 2
    Last Post: September 28th, 2004, 11:19 AM
  2. autofill field if blank
    By Lori in forum Microsoft Access Help
    Replies: 1
    Last Post: April 22nd, 2004, 11:13 AM
  3. Simple combo box/text box issue, difficult description (part 1)
    By etalent in forum Microsoft Access Help
    Replies: 1
    Last Post: March 29th, 2004, 05:16 PM
  4. Update field in a form
    By Rakshan Syed in forum Microsoft Access Help
    Replies: 4
    Last Post: March 19th, 2004, 03:03 PM
  5. user_defined optional field
    By Steve Schofield in forum SQL Development
    Replies: 0
    Last Post: July 29th, 2002, 04:43 AM

ASP Free Advertisers and Affiliates