Results 1 to 14 of 14
  1. #1
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237

    subform not allowing new additions with properties set true

    has any one had this issue before



    A subform will not allow to make entries into it, checked all properties data Entry, Edits and Additions are all set to yes but when I double check them afterwards they seem to reset themselves some how to no....

    the issue im having at the moment I have managed to get working but in a different way, when I doubled click on different subform which is inconvenient to the user.

    the code I have used to pull up the OrderForm is -


    DoCmd.OpenForm "OrderForm", acNormal, , "JoineryID_FK = " & Me.JoineryID_pk

    is it a simply property that I cant find or do I need to code this? seems strange that I could get it to work for one but not the other.

    the situation I have is -

    I have 1 parent form (JobDetails) and 3 subforms (JoineryUnit), (Orders) and (OrderDetails)... JoineryUnit is linked to JobDetails via JobNoID_PK and all 3 subforms are linked together...

    all parent and subforms have separate tables.

    when I click on JoineryUnit it shows all the Orders in the Order subform and when clicked on Orders it shows all Order Details in OrderDetail subform.

    I have created a form (OrderForm) so when double clicked on a particular joineryunit it pulls up the OrderForm with the Joineryunit filtered through and a new auto generated orderNumber is assigned.

    I inserted a subform into the OrderForm so that the Order can have multiple detail records and its this record that im having issues with...

    ive read this can happen due to a primary key violation but im not at all sure that is my problem.. if anyone could help would be much appreciated thanks

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    If the PK field of the table used by the subform is the same as the PK field of the table used by the main form, then you have a 1-1 relationship.
    That means you will only be able to have 1 record in the subform for each record in the main form.

    To fix, create a new PK field in the subform table and use the existing PK as a FK field
    Hope that makes sense
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by ridders52 View Post
    If the PK field of the table used by the subform is the same as the PK field of the table used by the main form, then you have a 1-1 relationship.
    That means you will only be able to have 1 record in the subform for each record in the main form.

    To fix, create a new PK field in the subform table and use the existing PK as a FK field
    Hope that makes sense
    yeah ok I can sorta get my head around that... and that might be happening ill check that out.

    if the case how do I create a new PK field in the subform.... I thought that was done when the tables were first created

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    You don't do that in the subform.
    Go to the table design view and edit it there
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    ok that's what I thought.

    sorry to clarify are you asking if each of my tables has its own Primary and Foreign Keys?

  6. #6
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Click image for larger version. 

Name:	Untitled10.jpg 
Views:	16 
Size:	120.6 KB 
ID:	32391

    Looking at my relationships, I take what your saying to make Suppliers in the Orders table a Primary Key and make the OrderID_PK - a Foreign Key...

    Im sort of thinking supplier should be in a separate table by itself as well, do you think this is needed?

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Quote Originally Posted by ShaunG View Post

    Looking at my relationships, I take what your saying to make Suppliers in the Orders table a Primary Key and make the OrderID_PK - a Foreign Key...

    Im sort of thinking supplier should be in a separate table by itself as well, do you think this is needed?
    NO.... keep the SupplierID as a FK in the Orders table with a separate Suppliers table as you have now

    However, I don't know which tables are used in your form & subform or which are the fields used to link them
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by ridders52 View Post
    NO.... keep the SupplierID as a FK in the Orders table with a separate Suppliers table as you have now

    However, I don't know which tables are used in your form & subform or which are the fields used to link them
    I can upload the database if you don't mind taking a look at it?

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Ok ... but it may not be till later today due to other projects.
    Please just upload the relevant tables and forms/subforms together with brief instructions to replicate your issue
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  10. #10
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by ridders52 View Post
    Ok ... but it may not be till later today due to other projects.
    Please just upload the relevant tables and forms/subforms together with brief instructions to replicate your issue
    that's fine I really appreciate you taking a look... llI try remove forms and tables but not hundred % sure which will compromise the database so do my best.

    its pretty easy and straight forward to replicate though.

    thankyou ill send through soon with instructions

  11. #11
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Login form should pop up, Select User - Shaun and S is the Password

    on navigational page - click on (view job progress)

    Joinery is the subform on L/H side, double click on a highlighted joinery name to open Orderform for that particular Joinery unit.

    the order form is very basic at this stage, most things will be locked, invisible and the user name and date automatically inserts when opened.

    all that should be needed is the supplier to be selected and then the details of the order.

    doesn't matter what I do, when ever I change the details of subform properties - data entry, additions, edits to yes, they change back to no when I reopened the properties to check.

    at one stage I had it working, but I had to double click on the OrderNumber instead of Joinery Name, so I tried to reconfigure to the Joinery Name and now I cant get it working at all.

    if you need any other info let me know and Thanks again.
    Attached Files Attached Files

  12. #12
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by ridders52 View Post
    Ok ... but it may not be till later today due to other projects.
    Please just upload the relevant tables and forms/subforms together with brief instructions to replicate your issue
    you wouldn't believe it but I just sorted it, ive been creating new forms from scratch and inserting the data I need ... so I just tried the form wizard for shits and giggles and it bloody work done the trick!! happy days

    still not sure where I went wrong as I tried everything the form wizard has done and still got no results.... not gonna complain its working after spending yesterday and today trying to work it out.

    thanks again.

  13. #13
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    Excellent - saves me a bit of time as well....!

    You would be amazed how often people solve a problem for themselves just after posting!
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  14. #14
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by ridders52 View Post
    Excellent - saves me a bit of time as well....!

    You would be amazed how often people solve a problem for themselves just after posting!
    im all about trying to save time lol... I bet just glad to work it out!

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

Similar Threads

  1. Subform data additions help
    By abbyjade99 in forum Forms
    Replies: 4
    Last Post: 08-13-2016, 05:45 PM
  2. SubForm not allowing new records
    By Calego in forum Forms
    Replies: 5
    Last Post: 08-15-2015, 05:35 PM
  3. subforms allowing additions
    By Csalge in forum Forms
    Replies: 5
    Last Post: 04-05-2013, 09:36 PM
  4. access not allowing me into properties.
    By jordan in forum Access
    Replies: 1
    Last Post: 12-06-2012, 03:41 PM
  5. acFormEdit is allowing form additions
    By kelann in forum Forms
    Replies: 2
    Last Post: 10-17-2012, 11:22 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