Results 1 to 3 of 3
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Insert into subform

    Hi it is possible to inserrt into subform from main form?



    I have form like belowe:

    Click image for larger version. 

Name:	tytulak.png 
Views:	16 
Size:	57.0 KB 
ID:	31129

    If user will use magic wand button all data from main form should be inserted into subform.

    Subform name is frmQry_Daty_status

    I am trying to write an sql statement:

    Code:
    INSERT INTO Form_frmQry_Daty_status(Data_Korekty, Kwota_korekty, Liczba_raportow, Cause_ID_FK) VALUES(#2014-03-01#,199,2,1)"
    but there is an error:
    table "Form_frmQry_Daty_status" cannot be found.
    how i should do it?

    Create query, use it as subform source and use insert into than?

    When user chooses for example date from 2017-08-06 to 2017-09-28 database have to insert to rows into subform.
    With date 2017-08-01 and second with 2017-09-01. And that is why i have choosen VBA to insert values.

    Please advice,
    Best Wishes,
    Jacek Antek

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    just run an append query. The data will show in the subform after you refresh it....

    docmd.openquery "qaAddData2Subform"
    me.subform.requery

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you ranman256 !!

    Jacek

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Insert data into a subform
    By Damo10 in forum Access
    Replies: 5
    Last Post: 07-29-2015, 02:58 PM
  2. Subform INSERT INTO...VALUES Problem
    By dipitiduda2 in forum Programming
    Replies: 1
    Last Post: 04-14-2014, 09:55 AM
  3. Replies: 1
    Last Post: 10-02-2013, 01:14 AM
  4. SubForm will not update after an insert
    By kowalski in forum Forms
    Replies: 11
    Last Post: 08-16-2013, 06:49 PM
  5. Replies: 3
    Last Post: 01-05-2012, 10:47 AM

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