Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Save form data (2003)

    I have a query which when run gives me a range of order details. I want to incorporate this into a form which holds other information, and then save the information. I have a similar form working at the moment, but the link to the two tables is the order number. I want to be able to display a range of orders but don't know to do this with a form.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save form data (2003)

    Can you use the query as record source of the form (or a subform)? If not, please try to give a more comprehensive description.

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Save form data (2003)

    I've stripped the database down of all the confidential information, and just left what works without it. As you will see, if you type a Cof Number in the CofC form, the details will appear for that Cof in the subform (you'll need to look in Table1) I want to be able to type in the range of Cofs and get the details for all of them. The other details of the CofC I can sort out easily.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save form data (2003)

    The Cof Number text box on the CofC form is bound to the Cof Number field, so typing in the text box will modify the record. I don't think that is what you want?

    If you want to use a range, you can't link the subform to the main form by the Link Master Fielsd and Link Child Fields properties.

    I would provide to unbound text boxes in which the user can enter the start and end values. Set the record source of the subform to a query that filters on Cof Numbers using these text boxes. Requery the subform in the After Update event of the text boxes.

    See attached version (I removed some superfluous items)

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Save form data (2003)

    The same records appear in every CofC now, or am I missing something

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save form data (2003)

    Yes, the subform has nothing to do with the record in the main form any more. You wanted to be able to display a range of CofC's in the subform, didn't you?

    It might be better to use an unbound main form.

  7. #7
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Save form data (2003)

    Think I'm going to have problems with the control names. The From and To controls are COFS. The main form is a CofC. I want to be able to display different Cofs in different CofC's

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save form data (2003)

    Apparently I have completely misunderstood your original question. I am completely lost. Could you try explaining again, very slowly and in simple terms?

  9. #9
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Save form data (2003)

    In the database I attached I could type in 1 COF Number on the CofC form. I could create another CofC, and type in another COF. So CofC No 1 could have details for Cof 7057, CofC No 2 could have details for Cof 7058 and 7059. This worked fine but sometimes we need to have more than 1 Cof detail on a CofC. One customer might have 1 Cof, another might have 3. I know Cof and CofC is confusing, but that's how our system works unfortunately.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save form data (2003)

    So one CofC can be associated with multiple Cofs. Can one Cof be associated with multiple CofCs or does a Cof always belong to a single CofC?

  11. #11
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Save form data (2003)

    The first part is correct, one CofC can be associated with multiple Cof's. A Cof will only appear on one CofC (I've had confirmation so I hope they're right). And the CofC will have no more than 4 cofs

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save form data (2003)

    You'll need to make some changes to the tables.
    1) The CofC table needs to have a primary key. The Serial No field is an AutoNumber, so that would be a good candidate.
    2) Remove the Cof Number field from the CofC table, and remove the corresponding control from the main form.
    3) Add a field to Table1 (I would give it a meaningful name, by the way) with the same name as the primary key in CofC. If you choose Serial No, it should be a Number (Long Integer) field here.
    4) Enter a valid key value in this field in existing records.
    5) Set the Link Master Fields and Link Child Fields properties of the subform on the main form to the name of the primary key/foreign key field.

  13. #13
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Save form data (2003)

    I might have a problem there. I use a 'make table' query to create the table, as the various fields are made up from other linked tables. This is the only way I know of making sure that the data is up to date. You see, the tables are linked to a manufacturing system. If there is another way, I would glady appreciate it.

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save form data (2003)

    You won't be able to do what you want with the current table structure. By having a Cof Number field in the CofC table, you can have only one Cof Number per CofC record. So you must either change the table structure, or accept that you can't have multiple Cof Numbers per CofC record.
    Perhaps you can create an empty table with the correct structure, then use a delete query to delete all existing records, and an append query instead of a make-table query to re-populate it.

  15. #15
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Save form data (2003)

    Creating a blank table might be the answer, but I'm confused about points 4) and 5) in your previous post. How do I give a serial number to something I haven't created a CofC for?

Page 1 of 2 12 LastLast

Posting Permissions

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