Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 568353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:10:47+00:00 2026-05-13T13:10:47+00:00

I use something like below to pass information from one unbound form to another

  • 0

I use something like below to pass information from one unbound form to another (excuse the no error checking):

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 = " & Me.As_MainID & ";"

' 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

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.

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.

so i tried to do this with a report:

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 = " & Me.As_MainID & ";"

' 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

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.

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:10:47+00:00Added an answer on May 13, 2026 at 1:10 pm

    You have a few options. You can either create a query, and pass the form control values into the values there, thus creating a 1 record query, which you can base your report on.

    Each Column will look like this: Data: Forms![MyForm]![MyControl]

    Or you can just bind the controls from the form directly to the report controls.

    You will need to leave the form open containing the values while the report is opened, if you opt for either of these routes. No complex code needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to use curl or file_get_contents to read something like http://example.com/python/json/ from
I would like to use something like CLR Profiles on .Net 2.0 to see
Right now we just use something like this stopWatch.Start(); try { method(); } finally
In short, why use something like http://stackoverflow.com/badges/6/supporter instead of something simpler (and subjectively, at
People use frequently something like: <ListBox ItemsSource={Binding ElementName=thisControl, Path=ListIndexes}> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Label Content={Binding
Is there something like InstallShield that I can use for free?
Is there something like a panel that I can use in a MFC application.
I use a pattern that looks something like this often. I'm wondering if this
Are there any preprocessor symbols which allow something like #if CLR_AT_LEAST_3.5 // use ReaderWriterLockSlim
Is it possible to use If Else conditional in a LINQ query? Something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.