Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Lansing MI

    Unanswered: Move to new record in a subform??

    Greetings. I am appending data from a flat file (that is viewed simultaneously on a form) to a form which includes normalized multiple tables/subforms. The form has several subforms all but one of which can have only one record. The one subform that has multiple records is causing the problems.

    The code reads the flat file and if it finds that the quantity is >0, it adds it to the Qty Field and then sets the item. This works great for the first one and if there is only one. There is a possibility of 16 items that can be added, however. If the code finds a second item, instead of going to a new record, it overwrites the first.

    How can I get the code to move to a new record? I have tried the setfocus to the subform and docmd go to record. Neither works. The gotorecord error says I can't go to the specified record.

    Any ideas are MOST appreciated!!
    Rick O

    The code is here:
    'Add Misc sales
    'Medium Tee Shirts
    If IsNull(Forms![WebScratch]![mtshirtqty]) Then
    Forms![DALMACMaster]![DALMAC].Form![Sales].Form![Qty] = Forms![WebScratch]![mtshirtqty]
    Forms![DALMACMaster]![DALMAC].Form![Sales].Form![Item] = 50
    End If

    'Large T Shirts
    If IsNull(Forms![WebScratch]![ltshirtqty]) Then
    DoCmd.GoToRecord , , acNewRec
    Forms![DALMACMaster]![DALMAC].Form![Sales].Form![Qty] = Forms![WebScratch]![ltshirtqty]
    Forms![DALMACMaster]![DALMAC].Form![Sales].Form![Item] = 51
    End If
    Last edited by Rickober; 01-30-03 at 09:52.

  2. #2
    Join Date
    Nov 2002

    Re: Move to new record in a subform??

    Add the data using the forms RecordsetClone.

Posting Permissions

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