Results 1 to 2 of 2
  1. #1
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162

    Checking\validating data in a subform?

    Hi all,



    Im trying to check for data in a subform and if its empty then allow the user to quit - can anyone shed some light on how to do this please? (Not too sure if its a vba question or not, although I will be trying to use VBA code)

  2. #2
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    Managed to work it out myself by using the following code:

    Code:
    Private Sub Exit_Database_btn_Click()
    If Forms![TimesheetForm]![TimesheetTableSubform].Form![SubActivity] = "" Or IsNull(Forms![TimesheetForm]![TimesheetTableSubform].Form![SubActivity]) Then
    DoCmd.Quit acQuitSaveNone
    Else
    MsgBox "Please submit your timesheet using the submit button"
    Was having a hard time understanding how access refernces subforms, and didnt realise you have to go from the top down to get to a control.

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

Similar Threads

  1. Microsoft Access - Validating Data
    By eric.kung in forum Access
    Replies: 3
    Last Post: 08-16-2011, 05:32 AM
  2. Validating mutiple entry in a subform
    By Grooz13 in forum Forms
    Replies: 1
    Last Post: 08-09-2010, 06:53 AM
  3. Checking for data in table
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 07-27-2010, 01:32 PM
  4. Validating data entry in a form
    By bdhFS in forum Programming
    Replies: 1
    Last Post: 05-18-2010, 03:09 PM
  5. Validating Field Data Across Tables?
    By venomshot in forum Forms
    Replies: 4
    Last Post: 02-04-2010, 05:04 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