Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

SubForm update MainForm

Discussion in 'Information Technology' started by Ernesto, Jul 28, 2006.

  1. Ernesto

    Ernesto
    Expand Collapse
    Guest

    hello all...

    I'm askin for help...again! =)

    I have create a form...which comtains product name..ID#...updated
    price...stuff like that...and within that form...i have a subform which
    contains any price changes that may occur.

    how do i update the subform's price to the main forms price? another
    thing i have on the main form...use can toggle between two tables by a
    button that changes record sources.

    any ideas?

    thanks!

    peace!
     
  2. Loading...


  3. NetworkTrade

    NetworkTrade
    Expand Collapse
    Guest

    how do i update the subform's price to the main forms price?

    ** If the form is based on a table or a query - then you need to move the
    new values in the subform to the source table/query of the form, and
    close/reopen the form.

    Not knowing the structure of things all I can do is give very general input...


    --
    NTC


    "Ernesto" wrote:

    > hello all...
    >
    > I'm askin for help...again! =)
    >
    > I have create a form...which comtains product name..ID#...updated
    > price...stuff like that...and within that form...i have a subform which
    > contains any price changes that may occur.
    >
    > how do i update the subform's price to the main forms price? another
    > thing i have on the main form...use can toggle between two tables by a
    > button that changes record sources.
    >
    > any ideas?
    >
    > thanks!
    >
    > peace!
    >
    >
     
  4. Ernesto

    Ernesto
    Expand Collapse
    Guest

    Let me try again...

    The structure of the dB is the following: there are (and will
    be...later) linked tables from other dBs. These tables (the linked
    tables) contain product name, product ID#, updated price, updated
    cost...etc. Due to the nature of our business, there will be a high
    number of linked tables. Now, I've created my dB to provide the linked
    tables' data via forms (main forms). Other users may enter updated
    information...updated costs....updated prices...via sub forms within
    the main forms. The main form is built form the linked tables. The sub
    forms are built from queries because there are a couple of calculations
    that users must see while entering updated info. Additionally, the main
    form contains buttons which changes the record source on the main form.
    This was created so users can move between the different linked tables.
    Does all of this make sense?

    Question: so where I'm having trouble is, trying to update the linked
    tables with the information that is entered in the subforms. If I do
    not use the buttons to which record sources, I can create an update
    query for each individual linked table, but that would cause a large
    amount of forms and sub forms and update queries. So, that is why I
    wanted to have the toggle button, to avoid the large amounts of forms
    and queries. (The linked tables all have the same structure, same
    fields, that is why I am able to use the toggle button to change record
    source).

    Does anybody have any thoughts...please let me know if I am not clear
    enough...i really need some help on this one...thanks!

    peace!
     
  5. Ernesto

    Ernesto
    Expand Collapse
    Guest

    YES!!!

    I got it...but I'm getting an error...here is the solution that I used
    (i may admit that it is a bit "layman", but thats what I am)...I just
    created an update query for each indiviual table (MainForm)...so an
    update query for each linked table...then on the Close event...I had it
    run all update queries.

    It works...but I get this error...

    "Microsoft Office Access can't update all the records in the update
    query

    Microsoft Office Access didn't update 4 field(s) due to a type
    conversion failure, 0 record(s) due to key violation, 0 record(s) due
    to lock violations, and 0 record(s) due to validation rule violations.
    Do you want to continue running this type of action query anyway?
    To ignore the error(s) and run the query, click Yes
    For an explanation of the causes of the violations, click Help"

    any ideas on how to get around this?

    thanks!

    peace!
     
  6. Ron2006

    Ron2006
    Expand Collapse
    Guest

    One of your queries is trying to load incorrect data into a field.
    alpha into numeric or alpha into yes/no type. You will have to look at
    the queries and try them one by one to find it/them.
     
  7. Ernesto

    Ernesto
    Expand Collapse
    Guest

    i'll try that...

    thanks!
     
  8. Ernesto

    Ernesto
    Expand Collapse
    Guest

    Should I look in the tables? or the queries?

    reason I ask is because I've made sure that the types are the same
    between the tables...and i still get the same error...

    ideas?

    thanks!
     
  9. Ron2006

    Ron2006
    Expand Collapse
    Guest

    It is the query that is trying to do the update, so the query is trying
    to update incorrectly.

    For example trying to load "yes" into a yes/no field and it should be
    loading True or False into a yes/no field.
     

Share This Page