Results 1 to 5 of 5
  1. #1
    rbiggs is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    23

    Validation Rule


    I have a Form and Subform. How can I make a rule that won't allow a user to enter data on the subform until the Mainform is filled out?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    There is no setting for this. Would require VBA code to control.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rbiggs is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    23
    Sorry I knew that it would require vba. Below is what I have. Right now whether or not the Main form (Dispatchmain) is filled out or not the message is triggered. The Invoice_CustomerID is what I want to be required to be filled out before the user fills out the subform. If possible I would prefer to not allow the user to select the subform at all.


    Private Sub DropOffLocation_Progression_Click()
    If (IsNull([Forms]![DispatchMain]![Invoice_CustomerID].Tag) Or [Forms]!DispatchMain]![Invoice_CustomerID].Tag = "") Then
    MsgBox "A selection from Bill To: above must be made be fore entering route information", vbOKOnly, "Bill to: Selection"
    Forms!BillToLBL.SetFocus
    End If
    End Sub

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You could set the subform container control to not visible or not enabled. Then in some event reverse this setting when criteria is met.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    rbiggs is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    23
    Thank you I got it to work

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Validation Rule Help!
    By confidego in forum Access
    Replies: 8
    Last Post: 07-20-2011, 12:54 PM
  2. Validation Rule
    By ritzzy in forum Access
    Replies: 1
    Last Post: 04-13-2011, 01:33 PM
  3. Help with validation rule
    By Desstro in forum Programming
    Replies: 5
    Last Post: 02-27-2011, 08:05 PM
  4. Validation Rule
    By Megan in forum Access
    Replies: 1
    Last Post: 11-05-2010, 09:45 AM
  5. Validation Rule
    By mistaken_myst in forum Database Design
    Replies: 2
    Last Post: 10-29-2007, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums