Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Angry Unanswered: Access report with a select satement in control source box

    I have created a table in access called table1.
    It has one field called field1. In field1 I imputed a number say 6.
    I then created a query called query1 from table1.
    In SQL the query reads as:
    SELECT Table1.field1
    FROM Table1;

    I then created a report and in the report I created a text box.
    In the text box properties I put in the Record source as:
    =(SELECT Table1.field1 FROM Table1)
    Now is it possible to use the select statement in the control source box.
    I have tried putting it in and I get an error on the report as #Name?.

    Any Ideas
    This is just an example
    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Nope. Set the report RecordSource to the table and then (as if by magic) any "ordinary" controls can be bound to the underlying columns of that table.

  3. #3
    Join Date
    Jul 2003
    Location
    Canberra, ACT Australia
    Posts
    53
    Originally posted by M Owen
    Nope. Set the report RecordSource to the table and then (as if by magic) any "ordinary" controls can be bound to the underlying columns of that table.
    try:

    =dlookup("[field_to_show]","table_name","[Field_to_compare] = " &[forms]![form_name]![control_name])

    cheers

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    I stand corrected ...

  5. #5
    Join Date
    Dec 2003
    Posts
    5
    Originally posted by rodmead
    try:

    =dlookup("[field_to_show]","table_name","[Field_to_compare] = " &[forms]![form_name]![control_name])

    cheers
    Thanks
    You directed me in the right direction!
    I used the dsum instead of the dlookupin my program and it worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •