Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2019
    Posts
    1,103

    Pass value from form's unbound textbox into report

    Hello:

    I'd like some assistance with passing a value from a form's UNBOUND textbox into a report. Please see attached ACCDB containing the following:

    For purpose of this question, key field is [T100_ACRONYMS].[SOURCE]
    Also, I have a query, form, and report associated with table [T100_ACRONYMS]

    Process:
    - Upon opening the ACCDB, form "F100_ACRONYMS" opens.
    - Unbound textbox "txtCountListbox" (labeled "All Records") shows value of "7" (i.e., total # of records in the table).
    - Now, in the yellow unbound textbox (labeled "Search by keyword..."), type in, e.g., "ABC" (i.e., one of the [SOURCE] values).
    - At this point, ubound textbox "txtCountListbox" (now labeled "Matching Records") is updated and shows a value of "3".

    ... so far so good.

    Next:
    - Click on command button "View Report".
    - Ignore the error dialogue box "Me"... this is what I'm trying to solve right now.
    - Here, in the report header, I have an unbound text box which currently shows all table's records (i.e., "7").
    - Instead, however, I want to show "3" (remember, when typing source = "ABC", that's the total count matching that source value).

    My question:
    - Based on the form's unbound textbox "txtCountListbox", how can I pass the active value of, e.g., "3" (for "ABC") or "2" (for "DEF") from the form to the report?

    I tried to use =DCount("*","T100_ACRONYMS","SOURCE=" & [Me].[txtSOURCE])... but again, that results in the "Me" error upon opening the report.
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2019
    Posts
    1,103
    Found solution:

    =[Forms]![F100_ACRONYMS]![txtCountListbox]

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

Similar Threads

  1. Pass textbox object into form
    By jaryszek in forum Modules
    Replies: 5
    Last Post: 11-02-2017, 05:47 AM
  2. Replies: 4
    Last Post: 05-31-2013, 07:00 PM
  3. Replies: 14
    Last Post: 05-13-2013, 04:27 PM
  4. Display PASS or FAIL using Unbound textbox
    By Shambler2 in forum Reports
    Replies: 7
    Last Post: 06-02-2011, 11:19 AM
  5. Replies: 4
    Last Post: 04-22-2011, 03:08 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