locked
Table field to expression RRS feed

  • Question

  • I'm working on a contract where each section/subsection is pulled from a table. Simple, right?

    There are sections where I've pulled information from my subcontract database, including name, company, etc. 

    I was hoping to run an expression with the script pulled from the contract field.

    Example: "My name is "&[The Name] 

    Is there a way to transfer the script from a table field to a report and have it display as an expression? It seems simple in theory...

    Tuesday, October 27, 2020 12:53 PM

All replies

  • I'm struggling to understand what you mean, but maybe Eval function is what you need. Look it up in the help file.

    =Eval("My name is " & Forms!frmLogin!txtUserName)

    My name is Tom van Stiphout

    You could also do a DLookup to look up a value in a table or query.


    -Tom. Microsoft Access MVP

    Tuesday, October 27, 2020 2:43 PM
  • have done a bit regulatory / legal app work.... it's tricky but you make the report object with generic text fields.

    then in the OnFormat event of the report you dynamically fill in the text that is being used...

    the record source of the report, the query, is where the correct data is established - that's another ball of wax....

    as posted by TvS - you can call in data from other forms assuming they are open & populated...not exactly sure your scenario...

    but if the scenario is that the users selects para 1, para 4,  para 6 to be in the doc... then the query/record source establishes the data....and then the OnFormat can assign the record source field to the generic text box...

    btw - can get very tricky in regard to even spacing / white space if the para are of wildly differing lengths....

    Thursday, October 29, 2020 10:21 PM
  • Is there a way to transfer the script from a table field to a report and have it display as an expression? It seems simple in theory...

    Hi WhydidIstartthis,

    An alternate way could be to pass the formatted string through the OpenArgs argument of the report, and extract it where needed.

    Imb.

    Friday, October 30, 2020 9:35 AM