Thought I would add a sample of the code.
##########################################################
Access Code
##########################################################
CurrentDb.QueryDefs("sp_CREATE_POOL_PARTY").SQL =
"EXECUTE " & _
"sp_CREATE_POOL_PARTY " & _
lngClientID & ", " & lngPoolID & ", " &
glngLoginID & ", '" & datPartyDate & "', '" & _
datStartTime & "', '" & datEndTime & "', "
& intNumGuests & ", " & intNumGuards & ", " & _
CCur(Me.txtRateGuards) & ", " &
dblTotalHrs & ", " & curTotalCost & ", " & fCB_Notice & _
", " & fCB_Size & ", " & fCB_ShockDay &
",'" & Replace(strSpecialRequest, "'", "''") & _
"', " & lngAG_EmpID
lng_ppID = DLookup("[ppID]",
"sp_CREATE_POOL_PARTY")
##########################################################
Stored Procedure
##########################################################
CREATE PROCEDURE dbo.sp_CREATE_POOL_PARTY
@lngClientID int,
@lngPoolID int,
@glngLoginID int,
@datPartyDate datetime,
@datStartTime datetime,
@datEndTime datetime,
@intNumGuests int,
@intNumGuards int,
@RateGuards money,
@dblTotalHrs float,
@curTotalCost money,
@fCB_Notice bit,
@fCB_Size bit,
@fCB_ShockDay bit,
@strSpecialRequest varchar(255),
@lngAG_EmpID int
AS
INSERT INTO
tblPP
(
ClientID,
PoolID,
SchedByUserID,
PartyDate,
StartTime,
EndTime,
NumPeople,
NumGuards,
RateQuote,
TotalHours,
Amount,
CB_Notice,
CB_Size,
CB_ShockDay,
SpecialRequest,
AG_EmpID
)
VALUES
(
@lngClientID,
@lngPoolID,
@glngLoginID,
@datPartyDate,
@datStartTime,
@datEndTime,
@intNumGuests,
@intNumGuards,
@RateGuards,
@dblTotalHrs,
@curTotalCost,
@fCB_Notice,
@fCB_Size,
@fCB_ShockDay,
@strSpecialRequest,
@lngAG_EmpID
)
SELECT @@IDENTITY AS PPID
GO
The stored procedure is actually executing two times
during the dlookup.
And it is executing two times when ever I open a
recordset.
Any clues?
Thorkyl