Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Jul 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy from one record to the next (access 2003)

    In the attached db I have a form I use in datasheet view to show data. I have an attached subform that the user updates. The user opens the subform by clicking on the + sign to open the subform, the updates the fields clicks the + sign again to close the form. Then repeats for the next record. What I would like to happen is when the user clicks the + sign again to go to a new form is to have the data from the fields below to auto popualte the new form instance. I could do this with a continuous form and it worked but the users would like to see the data in a datasheet design. Is this possible? Thanks...




    Me("Type").DefaultValue = """" & Me("Type").Value & """"
    Me("Severity").DefaultValue = """" & Me("Severity").Value & """"
    Me("EventStatus").DefaultValue = """" & Me("EventStatus").Value & """"
    Me("AdminDate").DefaultValue = """" & Me("AdminDate").Value & """"

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

    Re: copy from one record to the next (access 2003)

    I (almost) never use datasheet forms because they offer much less control to the designer/programmer than continuous forms do.

    The main form is based on a non-updateable query. Is that by intention?

  3. #3
    New Lounger
    Join Date
    Jul 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy from one record to the next (access 2003)

    Yes the main form has data about that should not be changed by the user. Does this mean what I want to do is not possible? The problem is the users before used spread sheets to do this and they are insisting and the same type format. Hard to break old habits I guess?

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

    Re: copy from one record to the next (access 2003)

    It works OK for me if I put the code to set the default values in the After Update event of the subform ONLY.
    Or do you want to set the default values even if the user doesn't change anything?

  5. #5
    New Lounger
    Join Date
    Jul 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy from one record to the next (access 2003)

    If you tab through the fields on the sub form it does carry them but when you close the form and use the plus sign to go to the next record the fields are blank in the subform. That's when I want the fields to be autopopulated. The subform should be a one to one relationship with the main form record..

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

    Re: copy from one record to the next (access 2003)

    If you have a one-to-one relationship, you don't need to store the data in different tables and use a subform. Just put everything in one table and one form.

  7. #7
    New Lounger
    Join Date
    Jul 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy from one record to the next (access 2003)

    The problem is in the real db not the sample I sent you the data in the mainform is a linked table to another db that is not updateable. So I can't store this data in that table.

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

    Re: copy from one record to the next (access 2003)

    I'm afraid I don't understand your database.

    Your main form will only display records from EIR_ELCT_IRR if there is already a related record in PNDATA_tbl. But since you want a one-to-one relationship, no new records should be added to the subform (although it is possible), so the default value doesn't come into play.

    If there is no related record in PNDATA_tbl, the record from EIR_ELCT_IRR will not be displayed in the main form, so it isn't possible to add a record in PNDATA_tbl, and the default value doesn't come into play here either.

    What am I missing?

Posting Permissions

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