Results 1 to 4 of 4
  1. #1
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338

    Required fields in subform

    Hello

    I have a main form with a subform. How can i make multiple fields on the subform required fields? I would like for a messages to pop up telling the users which field is null.



    Thank you

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I take it that you have the form/subform set up because you have tables that are related ina 1 to Many relationship---Is that the case?
    Are the fields you are talking about required in your table design Required = Yes?

    On your form you could have some sort of highlighted text that says --these fields are required,
    or you could perhaps put n asterisk beside the control on the subform, or perhaps you could make the background of the
    control a different color for required values.

    You could check for values in these controls before you allow the user to move on.
    If any of the required values is empty, have user go back to the empty control.

    Just some quick comments - hope they are helpful.

  3. #3
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    I'm using this code on main form
    If IsNull(Me.[Date of Service]) Then
    MsgBox "Please enter Date of Service!!!"
    Cancel = True
    [Date of Service].SetFocus
    End If

    When i use this code for the fields in subform, msgbox dosn't pop up.
    What's wrong with the code????

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    My guess is that [Date of Service] is NOT Null.

    Add a debug.print [Date of Service] to confirm
    You may also want to check the Len([Date of Service])

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

Similar Threads

  1. Replies: 5
    Last Post: 10-08-2011, 05:19 AM
  2. Conditionally Required Fields
    By HawkGuru in forum Programming
    Replies: 6
    Last Post: 10-03-2011, 05:47 AM
  3. Required Fields
    By scubagal in forum Forms
    Replies: 9
    Last Post: 09-29-2011, 07:26 AM
  4. combo box based subform and query help required!!
    By crustycrab101 in forum Forms
    Replies: 3
    Last Post: 05-03-2011, 01:39 PM
  5. Required Fields in a Form
    By Alaska1 in forum Access
    Replies: 3
    Last Post: 12-23-2010, 01:41 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