G
Guest
Good morning
I've combed the help files and I'm still struggling with this. I'm trying to use a dmax function with an AND in the criteria (argument3). I can't tell if I am having trouble with the syntax or what. I get a RunTime Error #94, "Invalid Use of Null".
Here's the function call:
=WOCount([Forms]![frmRequest].[Divn],[Forms]![frmRequest].[Classe]
Here's my code
Public Function WOCount(di As String, cla As String) As Strin
Dim strcstr As Strin
strcstr = "division = divn AND classe = classe" ' I used the strcstr because I'd like to eventually convert WOCount into
'string with formatting of "00000" - another challenge I'm having is that the Excel TEXT function doesn't seem to work her
WOCount = DLast("[WOID]", "tblRequests", strcstr) +
End Functio
divn and classe are both textbox control values on my form. Ultimately, the WOID will look like this DD-C-WWWWW where DD is a division abbreviation (always 2 letters), C is the Classification left(classification,1) of Building, Electrical, Plumbing, Refrigeration, etc, and WWWWW is the text version of the Work Order
Can someone please help? Thank you very much in advance
Derek
I've combed the help files and I'm still struggling with this. I'm trying to use a dmax function with an AND in the criteria (argument3). I can't tell if I am having trouble with the syntax or what. I get a RunTime Error #94, "Invalid Use of Null".
Here's the function call:
=WOCount([Forms]![frmRequest].[Divn],[Forms]![frmRequest].[Classe]
Here's my code
Public Function WOCount(di As String, cla As String) As Strin
Dim strcstr As Strin
strcstr = "division = divn AND classe = classe" ' I used the strcstr because I'd like to eventually convert WOCount into
'string with formatting of "00000" - another challenge I'm having is that the Excel TEXT function doesn't seem to work her
WOCount = DLast("[WOID]", "tblRequests", strcstr) +
End Functio
divn and classe are both textbox control values on my form. Ultimately, the WOID will look like this DD-C-WWWWW where DD is a division abbreviation (always 2 letters), C is the Classification left(classification,1) of Building, Electrical, Plumbing, Refrigeration, etc, and WWWWW is the text version of the Work Order
Can someone please help? Thank you very much in advance
Derek