I'm working in Access 2000 on code that was developed years ago in Access 97. I'm getting a data type mismatch, but I'm having trouble working out what to do.
My VBA code contains the following code:
Set oQuery = CurrentDb.CreateQueryDef("", sSQL)
oQuery.Parameters!BeginFY = BeginFY
At this point I get the error msg:
Run-time error 3615: Type mismatch in expression
The second statement calls the following code:
Public Property Get BeginFY() As Date
BeginFY = DateValue(CDate(txtBeginFY))
End Property
where txtBeginFY is a date keyed in using the form: mmddyy and a mask: 99/99/00;0;_
The query object oQuery:
PARAMETERS BeginFY DateTime, EndFY DateTime;
INSERT INTO DestTableName ( Region, AgencyID, Satellite, Subcontract, SSN, ComponentCode, ServiceCode, ServiceDate, Units, Each, Total )
SELECT [tblRegionsSAPT].[fldRegion], [tblUPS03].[fldAGENCYID], [tblUPS03].[NewSatelliteCode], [tblRegionsSAPT].[fldSubcontract], [tblUPS03].[fldSSN], [tblUPS03].[fldOldComponent], [tblUPS03].[fldServiceCode], [tblUPS03].[fldServiceDate], [tblUPS03].[fldUnits], [tblUPS03].[fldCost], [tblUPS03].[fldTotalCost]
FROM tblUPS03 INNER JOIN tblRegionsSAPT ON ([tblUPS03].[fldAGENCYID]=[tblRegionsSAPT].[fldAgency]) AND ([tblUPS03].[fldSatellite]=[tblRegionsSAPT].[fldSatellite])
GROUP BY [tblRegionsSAPT].[fldRegion], [tblUPS03].[fldAGENCYID], [tblUPS03].[NewSatelliteCode], [tblRegionsSAPT].[fldSubcontract], [tblUPS03].[fldSSN], [tblUPS03].[fldOldComponent], [tblUPS03].[fldServiceCode], [tblUPS03].[fldServiceDate], [tblUPS03].[fldUnits], [tblUPS03].[fldCost], [tblUPS03].[fldTotalCost]
HAVING (((tblUPS03.fldServiceDate) Between [BeginFY] And [EndFY]));
From searching the web I know there's a problem with paramaterized dates, but I'm at my wit's end figuring out how to eliminate the mismatch.
Can any of you wonderful, kind wizards help?
Bev
My VBA code contains the following code:
Set oQuery = CurrentDb.CreateQueryDef("", sSQL)
oQuery.Parameters!BeginFY = BeginFY
At this point I get the error msg:
Run-time error 3615: Type mismatch in expression
The second statement calls the following code:
Public Property Get BeginFY() As Date
BeginFY = DateValue(CDate(txtBeginFY))
End Property
where txtBeginFY is a date keyed in using the form: mmddyy and a mask: 99/99/00;0;_
The query object oQuery:
PARAMETERS BeginFY DateTime, EndFY DateTime;
INSERT INTO DestTableName ( Region, AgencyID, Satellite, Subcontract, SSN, ComponentCode, ServiceCode, ServiceDate, Units, Each, Total )
SELECT [tblRegionsSAPT].[fldRegion], [tblUPS03].[fldAGENCYID], [tblUPS03].[NewSatelliteCode], [tblRegionsSAPT].[fldSubcontract], [tblUPS03].[fldSSN], [tblUPS03].[fldOldComponent], [tblUPS03].[fldServiceCode], [tblUPS03].[fldServiceDate], [tblUPS03].[fldUnits], [tblUPS03].[fldCost], [tblUPS03].[fldTotalCost]
FROM tblUPS03 INNER JOIN tblRegionsSAPT ON ([tblUPS03].[fldAGENCYID]=[tblRegionsSAPT].[fldAgency]) AND ([tblUPS03].[fldSatellite]=[tblRegionsSAPT].[fldSatellite])
GROUP BY [tblRegionsSAPT].[fldRegion], [tblUPS03].[fldAGENCYID], [tblUPS03].[NewSatelliteCode], [tblRegionsSAPT].[fldSubcontract], [tblUPS03].[fldSSN], [tblUPS03].[fldOldComponent], [tblUPS03].[fldServiceCode], [tblUPS03].[fldServiceDate], [tblUPS03].[fldUnits], [tblUPS03].[fldCost], [tblUPS03].[fldTotalCost]
HAVING (((tblUPS03.fldServiceDate) Between [BeginFY] And [EndFY]));
From searching the web I know there's a problem with paramaterized dates, but I'm at my wit's end figuring out how to eliminate the mismatch.
Can any of you wonderful, kind wizards help?
Bev