Results 1 to 7 of 7
  1. #1
    djspod is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    164

    Access Sub form issue

    Hi All,


    I have built a main form which has a Sub form linked to the main form.


    All seems to work okay, However the user is able to select items in the Sub Form before the main form itself.


    If this route is taken by the user when they select an item in the main form the following appears. (Please see screen shot)


    I may have screwed a relationship or table up that is bound to the form?


    Ideally I would prefer the sub form be locked until all the details above in the main form are filled in first.




    Any ideas folks?


    https://drive.google.com/file/d/0B6r...ew?usp=sharing


    Username: darren godkin
    Password: test
    Click image for larger version. 

Name:	DB Screen Shot.jpg 
Views:	17 
Size:	109.1 KB 
ID:	21063https://drive.google.com/file/d/0B6r...ew?usp=sharing
    the form is the 'frmshortagesmain'

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    You CANT add items to the subform until the master form has a key. (1-many)
    Once the master key is created THEN you can add child records.
    Marty McFly cant exist until George meets Lorraine.

  3. #3
    djspod is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    164
    Thanks for the answer, I thought that but ar the moment you are able to make a couple of entries in the sub form beforehand.

    I want to limit the user from being able to do that and avoid that error

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Then remove the ability for users to add new master records. (form property)

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    (Aircode/Untested)

    You could, in Form Design View

    • Right-Click on the Subform Control
    • Click on Conditional Formatting
    • Under Condition1, with the dropdown, select 'Expression Is'
    • In the next box enter IsNull([Linking Field])
    • Click on the Enable/Disable Icon to Disable it
    • Click on OK

    Where Linking Field is just that...the Field that links the Form to the Subform.

    Linq ;0)>

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Linq, subform container control does not have Conditional Formatting. Wishful thinking guide your suggestion?
    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.

  7. #7
    djspod is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    164
    Thanks for your help everyone.

    Just out at the moment, I'll have a look later at the suggestions.

    Much appreciated, I'll feedback later.

    Thanks

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

Similar Threads

  1. Replies: 3
    Last Post: 03-17-2014, 10:23 AM
  2. Replies: 22
    Last Post: 05-21-2013, 07:54 PM
  3. Replies: 1
    Last Post: 05-02-2013, 08:04 AM
  4. Replies: 1
    Last Post: 03-18-2011, 03:22 PM
  5. Replies: 0
    Last Post: 07-13-2010, 07:45 AM

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