Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create a new record in another table (2000)

    Anyone any ideas for the following:
    I have a form which is used to allow the selection of a number of records. As each record is selected a number of calculated values are recorded to show total amount of stock delivered and total value of stock. I've got that all working - no problem.....
    next......
    I'm now attempting to write the total fields, along with some other information, to a table in another database. This should be recorded as a new record in a table.
    My first attempt is as follows:

    DoCmd.OpenTable "PODel", acViewNormal
    DoCmd.GoToRecord , , acNewRec
    LotNum = Forms!LotPricing!LotNumber
    PONum = Forms!LotPricing!PurchNo
    DelQty = Forms!LotPricing!SumInvWeight
    DelNum = Forms!LotPricing!DelNo
    DelReviser = "Auto"
    DelDate = Forms!LotPricing!DateBookedIn
    LineID = Forms!LotPricing!RawID
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.Close acTable, "PODel", acSaveYes

    But it doesn't append the record.

    Any one give me a pointer to how I should approach this?

    I guess I'm trying to produce, in effect, a transaction summary file

    Any help appreciated

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

    Re: Create a new record in another table (2000)

    You're mixing instructions for forms and tables together; unfortunately that won't work.

    Is PODel a linked table, connected to a table in another database? If so, you could either create an append query and execute that, or use DAO or ADO code to append a record. Are you familiar with either of these?

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a new record in another table (2000)

    I'm not familiar with DAO or ADO.
    The option of using an append query sounds a possibility - I'll investigate that one further.
    Yes, the PODel table is linked to a table in another database.

    As I right in thinking that once I'm working with one dataset (I know as much about datasets as I do about DAO and ADO) the only way to add to another table is via this route of an append query or the DAO ADO option
    John

  4. #4
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a new record in another table (2000)

    Using an append table worked great - thanks

Posting Permissions

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