If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#Error if no value
The below code is my control source for an unbound textbox. if there is no
value or o****, then I get the error; #Error How can I eliminate this ? =DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) |
#2
|
|||
|
|||
I would type:
=IIf (DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) 0, DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")), Null) Basically, if there is a date, show the date else show nothing... but someone might have a better idea. "Dave Elliott" wrote in message .. . The below code is my control source for an unbound textbox. if there is no value or o****, then I get the error; #Error How can I eliminate this ? =DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) |
#3
|
|||
|
|||
That requires 2 executions of the DCount. This may be better:
=Nz(DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")),Null) "Gina Whipp" wrote: I would type: =IIf (DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) 0, DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")), Null) Basically, if there is a date, show the date else show nothing... but someone might have a better idea. "Dave Elliott" wrote in message .. . The below code is my control source for an unbound textbox. if there is no value or o****, then I get the error; #Error How can I eliminate this ? =DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) |
#4
|
|||
|
|||
Both examples erred out ?
The end result is a count of course and the default count should be zero "Klatuu" wrote in message news That requires 2 executions of the DCount. This may be better: =Nz(DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")),Null) "Gina Whipp" wrote: I would type: =IIf (DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) 0, DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")), Null) Basically, if there is a date, show the date else show nothing... but someone might have a better idea. "Dave Elliott" wrote in message .. . The below code is my control source for an unbound textbox. if there is no value or o****, then I get the error; #Error How can I eliminate this ? =DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) |
#5
|
|||
|
|||
=IIf([Work Date]="", "",[DCount("[EmployeeID]","Employees","[Work Date] = " &
Format([Work Date],"\#mm/dd/yyyy\#"))) Hopefully this works for you. "Dave Elliott" wrote: The below code is my control source for an unbound textbox. if there is no value or o****, then I get the error; #Error How can I eliminate this ? =DCount("[EmployeeID]","Employees","[Work Date] = " & Format([Work Date],"\#mm/dd/yyyy\#")) |
Thread Tools | |
Display Modes | |
|
|