Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form and Subforms (Access XP)

    I have created a form with two subforms. The form is called Printer and the subforms are called Price and Parts subform. I want to use them to add data into the tables but when I go and try to add the cost of a part it does not let me enter anything.

    Why?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form and Subforms (Access XP)

    Is one subform a subform of the other, or are they two separate subforms of the main form?
    There are lots of things that could be wrong. How did you build the forms and subforms? What is the table structure ?
    One possibility is that the whole thing is based on a non-updateable query? Is there a query behind all this? If you open the query does it have a blank line at the end?
    Regards
    John



  3. #3
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form and Subforms (Access XP)

    John,

    I will try to answer the best I can. I used the wizard to create the form and subforms, so not sure if one is a subform of the subform. I don't have any queries yet, I am trying to design the form first but after your question, Do I have to create a query first? and if I do how do I do an updateable query?

    Thanks
    Rbelly

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form and Subforms (Access XP)

    OK
    My guess is you have three tables: Printers, parts and prices. Each printer has many parts, each part has many prices. (To allow for price changing over time)
    Your form shows a printer, the first subform list its parts, and when you select a part in this form, the other subform shows prices for that part.
    Is all that correct?
    Do you have any price and part data in the database already?
    Does the existing data show up correctly in the forms and subforms?

    Have you got the relationships correctly defined? Each printer has an identifier - say a printerID.
    Each Part has a PartID and a PrinterID to identify the printer it belongs to.
    Each price has a PriceID and a PartID to identify the Part it belongs to?
    Regards
    John



  5. #5
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form and Subforms (Access XP)

    Since I am a newbie to Access, I think it best to upload the database. i have done a lot of reading but I am struggling with "real world" know how [img]/forums/images/smilies/smile.gif[/img]

    Thanks
    Rbelly
    Attached Files Attached Files

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form and Subforms (Access XP)

    I don't have XP so I can't look at it. Someone else will. Otherwise do you know how to save it back to Access2000?
    Regards
    John



  7. #7
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form and Subforms (Access XP)

    It is in 2000 format but I did it in the 97 version and here it is.

    Rbelly
    Attached Files Attached Files

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form and Subforms (Access XP)

    Sorry, I just assumed the file was in XP without even trying it!

    I attach a version (2000) where the subforms work. There was really only one thing wrong.
    The prices table needs a VendorID in it. Your prices subform had a vendor name field, but no vendor ID.
    I have changed the control on the form to a combo box. This has two columns, first holds the VendorID, the second the vendor name. This controls stores the vendorID, but by setting the width of col1 to 0, it displays the vendor name.
    I also changed the subforms from datasheet view to continuous forms.
    I have included the PartsID field on the Pricessubform just so I could see the value. You can hide or remove that.
    I also used the wizard to create a complete new form, and selected vendorID instead of VendorName and it worked first time.
    Attached Files Attached Files
    Regards
    John



  9. #9
    Star Lounger
    Join Date
    Jul 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form and Subforms (Access XP)

    Thanks [img]/forums/images/smilies/smile.gif[/img]
    I will review today and see how to do it!

    Rbelly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •