Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149

    I must be doing something wrong then. I just copied all your code and pasted it directly into my Event and ran it. It opens the Form "InvoiceDataEntryF" and then stops with error. It desnt open the subform. I took a screnshot of what I get.Click image for larger version. 

Name:	error001.JPG 
Views:	14 
Size:	57.5 KB 
ID:	33893

  2. #17
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    Oh , nevermind lol. Sorry, I correted the spelling in the subform name so thats why it erored. Returned it to normal and now its working

    Thank you so much for ll your help. I do ppreciate it

  3. #18
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    I went live with my database today and Im adding qoutes and hitting convet to invoice. For some reason the sunform only copies one record to the invoice subform nstead of all the records. Is there a tweak I can add to my code so that it copies all the records from the qouteDetailsSubform to the invoicedetailssubform?

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    The code is only intended to copy one record and nothing in your posts indicated you wanted to copy multiple records. Try this:

    Code:
    DoCmd.OpenForm "InvoiceDataEntryF", acNormal, , , acFormAdd, acWindowNormal
    Forms!InvoiceDataEntryF![CustomerID] = Me![CustomerID]
    Forms!InvoiceDataEntryF![VAT] = Me![VAT]
    Forms!InvoiceDataEntryF![InvoiceNotes] = Me![QouteNotes]
    DoCmd.RunCommand acCmdSaveRecord
    CurrentDb.Execute "INSERT INTO InvoicDetailsT(InvoiceID, Code, Qty, IPrice) SELECT " & _
        Forms!InvoiceDataEntryF.InvoiceID & _
        " AS IID, Code, Qty, QPrice FROM QouteDetailsT WHERE QouteID=" & Me.QouteID
    Forms!InvoiceDataEntryF.[InvoicDetailsTSubform].Requery
    Misspelling of Quote driving me nuts.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    Lol...IOkay I changed all the qoutes to Quotes and had to redo the Quotes form but it's now working as it should thanks to your new code

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You might also want to correct InvoicDetailsT and InvoicDetailsTSubform to include the 'e' in Invoice. Also remove space from QuoteDetails Subform or replace with T to be consistent with InvoicDetailsTSubform. Or remove that T.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-20-2015, 12:55 PM
  2. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  3. Copy record from one table to another
    By jpkeller55 in forum Access
    Replies: 8
    Last Post: 03-05-2013, 12:16 AM
  4. Replies: 7
    Last Post: 05-03-2012, 06:00 PM
  5. Copy record to different table
    By Patience in forum Access
    Replies: 27
    Last Post: 06-03-2010, 12:19 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