Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2012
    Posts
    23

    Question Unanswered: Prefill Continuous Form

    Hello guys,

    I have a main form that opens continuous form on button click. I was wondering is there any way to prefill continuous form on click without using Currentdb.Execute "INSERT..." statement?

    Thank you.

  2. #2
    Join Date
    Nov 2012
    Posts
    32
    Hi David,

    If you were using a single INSERT statement, why not use a SELECT query as recordsource?

  3. #3
    Join Date
    Jan 2012
    Posts
    23
    I need 4 entries to magically appear in continuous form when i click add button on main form. I know how to do it with insert statement, was wondering if there is easier solution that continuous form can offer...

  4. #4
    Join Date
    Nov 2012
    Posts
    32
    If you don't want to physically modify data (INSERT statements), you are left with queries and recordsets. I would suggest to try some tricks with queries with parameteres - on that button click pass parameter to query that would include those new records... or swap the query entirely. If you cannot build a query with those records, you can always assign a recordset as form recordsource and modify it by VBA, but that would be too much of a hassle.

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    there is another way which would be to type the 4 magic rows yourself, although its time consuming and prone to errors. so personally I'd fall back on the insert option. its quicker, more reliable and less error prone. its also very very easy
    Code:
    strSQL "INSERT INTO mytable (my,column,list) VALUES (1,'blah',#2013/11/25#)"
    docmd.runsql (strSQL)
    strSQL "INSERT INTO mytable (my,column,list) VALUES (2,'oops',#2013/11/24#)"
    docmd.runsql (strSQL)
    ...
    strSQL "INSERT INTO mytable (my,column,list) VALUES (4,'verdammte',#2013/11/21#)"
    docmd.runsql (strSQL)
    you might have to requery the subform to make certain the rows are seen
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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