+ Reply to Thread
Results 1 to 5 of 5

Dlookup in access report

  1. #1
    Registered User
    Join Date
    03-31-2014
    Location
    X
    MS-Off Ver
    Excel 365 enterprise
    Posts
    52

    Dlookup in access report

    Hi all,

    I'm dealing with this crazy database at work and I have no idea how to solve this problem:

    One of the reports required is a weekly forecast. Inside the report I created several boxes to show the week end dates using these commands =DateAdd("d",0,[Enter Starting Month dd/mm/yy]) , =DateAdd("d",7,[Enter Starting Month dd/mm/yy]), =DateAdd("d",14,[Enter Starting Month dd/mm/yy]), etc until =DateAdd("d",357,[Enter Starting Month dd/mm/yy]).

    What I'd like to do is lookup the date inserted in order to show the number of working hours for a week.

    In a table called "weekly calendar" I stored some data in this way:

    Please Login or Register  to view this content.
    I tried to use the below formula in the same report:
    =DLookUp("wca_hours","weekly calendar","wca_weekd= #Label178#") #where Label178 is supposed to be the name of the box with =DateAdd("d",0,[Enter Starting Month dd/mm/yy]) as Control Source

    In other words what I'd like to achieve is: If the user insert "20/01/2017" the report should show 36

    Well... it doesn't work LOL. I get a #Error message!

    I'm not good with Access at all and I just thought that perhaps there is a good soul in this forum able to help me :-D

    Thanks all!!

  2. #2
    Registered User
    Join Date
    12-06-2016
    Location
    India
    MS-Off Ver
    2007
    Posts
    72

    Re: Dlookup in access report

    Hi,

    Try this

    =DLookUp("wca_hours","weekly calendar","wca_weekd=" & me.Label178 )

  3. #3
    Registered User
    Join Date
    03-31-2014
    Location
    X
    MS-Off Ver
    Excel 365 enterprise
    Posts
    52

    Re: Dlookup in access report

    Hi guru008,
    I get a #name? error. What "me." is supposed to be?

  4. #4
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: Dlookup in access report

    You shouldn't need Dlookup in a report.
    The query should provide all data.

  5. #5
    Registered User
    Join Date
    03-31-2014
    Location
    X
    MS-Off Ver
    Excel 365 enterprise
    Posts
    52

    Re: Dlookup in access report

    Hi ranman256,

    I'm not good at all with Access and I thought about it. To be honest I have no idea how to achieve it though considering that this command =DateAdd("d",0,[Enter Starting Month dd/mm/yy]) force me to "insert" a date before to run the report and not in a query...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Access Report with VBA USerForm
    By Parth007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2015, 06:57 AM
  2. Access: Using two tables in a query using a "Dlookup"
    By mirving in forum Access Tables & Databases
    Replies: 2
    Last Post: 06-19-2015, 12:04 PM
  3. [SOLVED] Access Report Template
    By jonboy6257 in forum Access Tables & Databases
    Replies: 7
    Last Post: 11-21-2013, 09:50 AM
  4. help with dlookup
    By enhydra in forum Access Programming / VBA / Macros
    Replies: 8
    Last Post: 06-07-2011, 05:35 PM
  5. Run Access report from Excel ?
    By rwilsonie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2011, 02:57 PM
  6. Open Access Report
    By Rose0402 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2008, 11:36 AM
  7. Access help-Formulas in report
    By Snooza35 in forum Excel General
    Replies: 1
    Last Post: 04-20-2007, 07:27 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1