Re: DCount

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Try this:

intSameDay = DCount("[ID]", "PM Date Errors Asc", "[Days to Complete] =" &
int1 & " And [ESDStaffName] = '" & strStaffName & "'")

Make sure int1 is a number or use CLng(int1) instead.

Lamar wrote:
I want use the DCount function but I am having problems with criteria
expression. When I run the code, it keeps telling me there is "data mismatch
in the criteria expression". [Days to Complete] is a field where the data
type is Number. int1 is an integer but I have also made it string.
[ESDStaffName] is a field where the data type is Text. strStaffName is
string. Do I have to change the field [Days to Complete] to a different
data type? Any help is appreciated. Thank you.

intSameDay = DCount("[ID]", "PM Date Errors Asc", "[Days to Complete] ='" &
int1 & "' And [ESDStaffName] = " & "'" & strStaffName & "'")

--
Message posted via http://www.accessmonster.com

.



Relevant Pages

  • Re: New to Classes, please help.
    ... David Lozzi ... > A class is a data type, just as an integer or a string. ... >>> example, username dlozzi, password fun. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [1/1][PATCH] nproc v2: netlink access to /proc information
    ... Nproc, on the other hand, uses field IDs to identify information. ... Data type ID ... For strings, the string itself is prepended with a u32 indicating the ... the kernel suggests "VmShared" as a label, "%8u" for formatting, ...
    (Linux-Kernel)
  • Re: Insert values into Table
    ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... string in code, and let me ask you a question as well. ... Is this column a date data type or a text string? ...
    (microsoft.public.access.modulesdaovba)
  • Re: Dates
    ... The conversion of a char data type to a datetime data type resulted in an ... out-of-range datetime value. ... System.Data.Common.DbDataAdapter.FillFromReader(Object data, String ... srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: runtime error with Mask edit control
    ... DateOfBirth property is a string. ... If no value is entered into the Property, the database stores a null. ... > its data type (one would assume the same as the property, ...
    (microsoft.public.vb.controls)