Results 1 to 5 of 5
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Expression on report.


    I created a table t01BusinessInfo with field BusinessName. Query is q01BusinessInfo and report r01BusinessInfo and form f01BusinessInfo. There is also a report r01Customer. In the pageheader of report r01Customer I added a text field. What expression will return the contents of form f01BusinessInfo text fieldname T001 to text field in r01Customer? I.E. =[Forms]![f01BusinessInfo]![T001]

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Are you trying to restrict the report to only show the current customer selected in the form?

    If so use the reports recordsource query and put the form reference in the criteria for the customer name/ID in the query
    Moving forwards I would rename your form controls to something more memorable e.g. [Forms]![f01BusinessInfo]![txtCustomerName]

    I'm also not sure that using 01 etc in your naming convention is going to help you in the long run. But at least you have a naming convention so perhaps I should shut up
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Hi, thank you. I am Hans from South Africa. Used a lot of time in 2016 on Access. No time used in 2017. Quite proud of my development though. I thought this issue should be simple. I created a table which keeps only one business info, my business. For the purpose of being able to return the info to reports like invoices or any other reports. I achieved that through query and joining the BusinessInfo table and Invoice Table. I still wonder if there is an expression though. In the page header can one add a text field an have an expression that return the info in the field of table BusinessInfo.

  4. #4
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    You can use a DLookup in the report if it just one record in the business table.
    DLookup("BusinessName","t01BusinessInfo") would get you the name straight out of the table.

    Or you can simply add the table - without a join - and refer to that field, this will cause a Cartesian join, which may slow down things if there are lots of records.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Great. It worked. In 2016 I posted this request, and never got a reply that worked. Thanks.

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

Similar Threads

  1. How to use an expression in a report
    By gbritton in forum Access
    Replies: 5
    Last Post: 03-24-2016, 03:09 PM
  2. Need help with a report expression
    By Rustyone in forum Reports
    Replies: 4
    Last Post: 01-31-2014, 09:57 PM
  3. Replies: 2
    Last Post: 05-10-2013, 03:37 PM
  4. Using an Iif expression in a report
    By jsfasman in forum Reports
    Replies: 2
    Last Post: 04-28-2013, 11:58 AM
  5. Expression on Report #Name?
    By burrina in forum Reports
    Replies: 0
    Last Post: 01-06-2013, 02:42 AM

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