Note that there are some explanatory texts on larger screens.

plurals
  1. POMS ACCESS 2003 - Question about passing information from an unbound form to a report
    primarykey
    data
    text
    <p>I use something like below to pass information from one unbound form to another (excuse the no error checking):</p> <pre><code>Sub Button_Click() Dim db as DAO.database Dim rs as DAO.recordset Dim sql as string docmd.openform "NextFormIamAbouttoUse" sql = "SELECT * FROM tblMain WHERE MainID = " &amp; Me.As_MainID &amp; ";" ' usually debug here set db = currentdb set rs = db.openrecordset(sql) if rs.eof then msgbox "oops message" else rs.movefirst [Forms]![NextFormIamAbouttoUse].as_mainID = rs![MainID] [forms]![NextFormIamAbouttoUse].value1 = rs![value1] ' etc rs.close set db = nothing set rs = nothing sql = "" end if 'error stuff end sub </code></pre> <p>ok so i can use this kind of thing for transferring information from forms to reports as well? see i use a lot of forms full of text boxes as dashboards, where the text boxes serve no entry purpose, rather display quick information rather.</p> <p>user navigate through different forms to build the "dashboard-like" forms to their liking then at some point want to print. so i wanted to build look-a-like (in terms of the data offered) reports at each point so they can print the page of information they have built through these forms.</p> <p>so i tried to do this with a report:</p> <pre><code>Sub Button_Click() Dim db as DAO.database Dim rs as DAO.recordset Dim sql as string docmd.openreport "ReportTester", acViewPreview sql = "SELECT * FROM tblMain WHERE MainID = " &amp; Me.As_MainID &amp; ";" ' usually debug here set db = currentdb set rs = db.openrecordset(sql) if rs.eof then msgbox "oops message" else rs.movefirst [reports]![ReportTester].as_mainID = rs![MainID] [reports]![ReportTester].value1 = rs![value1] ' etc rs.close set db = nothing set rs = nothing sql = "" end if 'error stuff end sub </code></pre> <p>just as a guess, and it didn't work. no errors, or anything. just will not display any information this way. won't even pass the ID number.</p> <p>So I am thinking that opening the report in AcViewPreview means that I cannot add information to those text boxes after the fact, but I am jsut not certain. So any advice on this is much appreciated. thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload