Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69

    Only SubForm is visible, main form not visible!

    I was trying to create a subform and created 2 forms first with all codes and combo boxes etc. I then inserted the Sub form "CustSODtlsFrm" (see enclosed DB)
    Views: 6 Size: 48.0 KB">TestDB-SO.zip
    into the main form "CustSOHdrFrm" using the link field "HdrID" in sub form with "ID" of main form.

    Both forms work fine when used individually before linking. However after inserting the sub form I see the 2 forms clearly in the Design view. However in the Form view the main form CustSOHdrFrm, I can see ONLY the sub form and not the main form. I browsed for all possible reasons, bit could not find a solution

    I had tested the process earlier with limited fields and I did not have a problem.

    In the enclosed DB, there is no data but all the tables used are included

    The 2 forms are unlinked in the enclosed DB

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    I was trying to create a subform and created 2 forms first with all codes and combo boxes etc. I then inserted the Sub form "CustSODtlsFrm" (see enclosed DB) TestDB-SO.zip into the main form "CustSOHdrFrm" using the link field "HdrID" in sub form with "ID" of main form.
    I can't see a field called "HdrID" so have assumed your FK is "HeaderID".

    I couldn't see a subform so I've used the wizard to create one.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi Anil

    Very difficult to understand what it is you are trying to achieve as I cannot understand your table Names ?

    You have 4 tables with NO Relationships set between any tables.

    Can you explain in a bit more detail what is the purpose the database?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Anil,
    I agree with Mike that your tables are somewhat confusing. All have ID as a PK?
    What is the "business" these tables are intended to support (an brief overview in simple English)?

    Bob has designed/constructed a form/subform set up, but we're all not sure of your requirement and your "business".
    A brief description would help with to put your post into context.

  5. #5
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    Thanks Bob. For a better understanding:

    1. What is FK?
    2. Did you change any Form properties
    3. The sub form was SODtls form which you have used too and it had the HeaderID field in the table and the form which I used for linkage. I deleted the subform before shring the DB. The process I had used was below to add the sub form to the Main form. Please inform where I went wrong. This learning is important for future

    a) I went to the footer of the main form in Design view and used the Controls to add a sub form.
    b) In the wizard which popped up, mentioned the link between HeaderID in sub form and ID of the main form

    Once this was done and I switched to the form view of the main form, I could ONLY see the sub form!

    Will appreciate a reply so that I am bale to create the form myself

  6. #6
    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
    You have the Data Entry Property on both your Main Form and Subform set to Yes!

    Try setting them both to No and see what happens.

    Setting Data Entry Property to Yes means that you can only enter New Records...and isn't appropriate for a Main Form/Subform set up.

    As with a number of things in Access, the name Data Entry Property is misleading...it doesn't have to be set to Yes in order to enter data!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    Thanks Linq. That was it. I changed the properties and it was done.

    It was sure was misleading. The default is No as I just checked. Since I had an issue I changed it as per some advice I read. I obviously did not understand it correctly. Your explanation was so simple and easy to understand.

    You are right, not the first thing in Access which is ambiguous or misleading

    Many thanks.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    FK = Foreign Key

    PK = Primary Key

    Both forms set as Data Entry Yes not an issue for me. Why would this not be appropriate? Certainly can set up so user is allowed to only enter new records, not edit existing.

    If you want subform to associate with parent record on main form, should be in Details section - not header or footer.
    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.

  9. #9
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    Thanks June7. I had misunderstood the implication of Data Entry. I do want to edit the reocords in header and Footer and so have sent property to No

    I was able to insert the sub form in the Details of the Header form and also in the Footer. What are the pros and cons of Footer vs Details? Is this the best way or Modal form is a better option?

    2 more requests

    1. How do we delete records in the Sub form when in the header Master/subform view?
    2. I want to have a Sr no in the footer which is dynamically updated even after deletion of a record When I browsed, the codes available are so confusing and they assume the reader has decent Access skills, which I dont have

    Appreciate your help as always

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Don't think I've ever set up a form with data controls in form header or footer, just in detail section.

    Delete a record by selecting it and clicking Delete key.

    I don't even understand item 2 request.
    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.

  11. #11
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    Somehow the couple of videos I saw on creation suggested to add the Sub form in the Footer of the main form. I am using it as suggested in the Detail of them Master form.

    Serial Number of Sub Form

    Assume there are 8 items in the Subform. I want a column to indicate the Serial number say 1 to 8.

    Q1 - how does one go about it? Do we add a text field in the Subform? How does it auto-generated? The Serial No should be reset to start from 1 for each header record (which in my case is the Sales Order!)
    Q2 - If I delete a record in the sub Form, the Serial no should reset. So if I delete serial no 4 of sub form, Sr 5 to 8 will be renumbered as 4 to 7

  12. #12
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Try:

    Add a text box to the form.
    Set its Control Source property to: =[CurrentRecord]
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    =[CurrentRecord] just shows 1 in all records for me.

    Row numbering records in form is difficult. Easily done on report. Review http://allenbrowne.com/casu-10.html
    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.

  14. #14
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    What I am trying to achieve is as under

    1. We need to book orders.
    2. The orders have a header or main portion where we have a customer, its related parties. These 2 sets of information come from a customer table and the Customer partner function. This helps in capturing the 3 sets of customer codes
    3. There are some commercial terms like Incoterms, terms of payment etc which come from the customer master based on the 3rd code captured.
    4. Once this is done we capture different items of the order in the sub form. Some of this information comes from the Item master. There are a lot of user inputs like quantity, amendments to order, amendment date which are captured for each line item of the SO
    5. I have the standard PK in all tables which really is not always used but since a unique number is needed always in tables as a PK, I use ID field in all tables as a PK which is an autonumber field. This perhaps is not a very healthy practice as I can sense from the posts in this thread.

  15. #15
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Quote Originally Posted by June7 View Post
    =[CurrentRecord] just shows 1 in all records for me.

    Row numbering records in form is difficult. Easily done on report. Review http://allenbrowne.com/casu-10.html
    Hi June7
    Have attached the db that works for me.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 11-21-2019, 03:30 AM
  2. Replies: 3
    Last Post: 05-02-2018, 11:37 AM
  3. Replies: 3
    Last Post: 06-29-2017, 03:02 PM
  4. Replies: 1
    Last Post: 03-21-2016, 10:40 AM
  5. Replies: 2
    Last Post: 01-06-2011, 04:38 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