Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Hamm -

    I followed the process (from Microsoft) you provided in your first post on an old db that had a form and subform. The main form and subform were linked together using link child & link master fields using SalesID (an autonumber in the SalesTBL and an fklng in the SalesDetailsTBL). The code and process worked without error. Below is the append query SQL for my test (example):

    INSERT INTO SalesDetailsTBL ( SKU, CSQTY, UnitCost, Freight, SalesID )
    SELECT SalesDetailsTBL.SKU, SalesDetailsTBL.CSQTY, SalesDetailsTBL.UnitCost, SalesDetailsTBL.Freight, CLng([Forms]![SalesTBLFRM]![SalesID]) AS NewSID
    FROM SalesDetailsTBL
    WHERE (((SalesDetailsTBL.SalesID)=[Forms]![SalesTBLFRM].[Tag]));

    So, I suspect, there is just a syntax or field alignment issue in your append query which when fixed, should produce the desired results.

    Question, in the Assets Table, is ID an autonumber field? If so, I would try something like...

    INSERT INTO Assets ([Job Number], [Currency], [Market Value/Sale Price], NIY, [Income Type], [Property Name], [Asset Type], [Parent Brand], Brand, Category, [No of Rooms], Airport, Golf, Country, City, Address, [Service Line], [Assignment Type], Client, [Project Name], [Project Leader], [Date Billed], [Archive Location], [Size], [Job ID] )


    SELECT Assets.[Job Number], Assets.Currency, Assets.[Market Value/Sale Price], Assets.NIY, Assets.[Income Type], Assets.[Property Name], Assets.[Asset Type], Assets.[Parent Brand], Assets.Brand, Assets.Category, Assets.[No of Rooms], Assets.Airport, Assets.Golf, Assets.Country, Assets.City, Assets.Address, Assets.[Service Line], Assets.[Assignment Type], Assets.Client, Assets.[Project Name], Assets.[Project Leader], Assets.[Date Billed], Assets.[Archive Location], Assets.Size, CLng([Forms]![Job Details]![ID]) AS NewJobID
    FROM Assets WHERE(((Assets.[Job ID])=[Forms]![Job Details].[Tag]));

    Test and see if this produces the needed results.

    All the best,

    Jim

  2. #17
    alcapps is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    292
    usually I add vba code to the subform .. Before Insert
    that moves the id to the records.

    example.. main form, ID on it.
    sub form field jobid
    Before Insert-of subform
    me.jobid = me.parent.ID

    then before the new record is inserted it puts ID into the JobID field. So I hide this field on the sub form because you are taking care of this field yourself.

    Al

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-02-2012, 11:00 AM
  2. Replies: 2
    Last Post: 05-02-2012, 09:16 PM
  3. Replies: 1
    Last Post: 04-15-2011, 04:04 AM
  4. Duplicate record in Subform
    By j2curtis64 in forum Forms
    Replies: 3
    Last Post: 04-13-2011, 03:58 PM
  5. Replies: 0
    Last Post: 01-06-2009, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums