Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count/DCount (A2k)

    Good Morning,

    I have the following code that works fine for counting the number of calls/cases for the specific date.

    However, I wish to expand on it a bit and not sure how to do this.
    I want to COUNT by DATE and by DEPT. i.e. on this day for each dept count how many cases worked.

    Me.CallNum = Nz(DMax("CallNum", "tblLasers", "CallerDate=Date()"), 0) + 1

    Can someone elaborate on this for me?

    Thanks in advance
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Count/DCount (A2k)

    It seems to me that you want to return more than one value ("for each dept count how many cases worked"). If that is correct, you can't use Me.CallNum = .... for that would assign only a single value. How would you like to display the values? If I read your question incorrectly, can you explain?

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count/DCount (A2k)

    Hans,

    No...not what I'm looking for. Should only be one value.

    i.e. the table is as follows:
    Date
    LFDept
    FNum
    MaidNum

    On form, MaidNum is entered which the produces the Date automatically and takes the user to LDept. Dept is selected.
    Once LFDept (combo box) is selected, I'd like the the code to look up (DLOOKUP?)the DMax value for THAT dept and enter the next number. For instance:

    1/21/05 Retro (LFDept) 123456 (MaidNum) 1 (LFNum)
    1/21/05 Acute (LFDept) 789466 (MaidNum) 1 (LFNum)
    1/21/05 Retro (LFDept) 456798 (MaidNum) 2 (LFNum)
    1/21/05 Retro (LFDept) 787878 (MaidNum) 3 (LFNum)
    1/21/05 Acute (LFDept) 111111 (MaidNum) 2 (LFNum)
    1/21/05 Psych (LFDept) 222222 (MaidNum) 1 (LFNum)

    I hope that is less confussing....and apologize for the confussion.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Count/DCount (A2k)

    Try

    Me.CallNum = Nz(DMax("CallNum", "tblLasers", "CallerDate=Date() And LFDept = " & Chr(34) & Me.LFDept & Chr(34)), 0) + 1

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count/DCount (A2k)

    Hans,

    Tried your suggestion....1/2 way works....it does separate the Depts but the # never increases. I continue to get 1 as the LFNum. Any other suggestion....I'd just have jump up and down and make a fool of myself .....

    Thanks....
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  6. #6
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count/DCount (A2k)

    Hans,

    I'm Jumping...yes a FOOL I'm...all is working Perfectly....YOU R Wonderful!!!

    Thanks so much...
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Count/DCount (A2k)

    I don't think we can solve this without seeing the database. Could you post a stripped down version? See <post#=401925>post 401925</post#> for instructions.

Posting Permissions

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