C
conjured.illusions
This is the first adp I've worked with so I'm pretty new at this.
I'm using Access 2003 with SQL Server 2000.
I keep getting an error: Line 1: Incorrect syntax near '/'. When I
try to execute a stored procedure from a button. Basically what I'm
doing is running a stored procedure, and dumping the output to a temp
table that I've built and calling the report afterwards to run off
that data.
Here's the code for the button. I've tried to use single ' ' around
the variables that have the dates, but that doesn't seem to work
either.
Any help would be appreciated !
Private Sub packing_champ_scorecard_Click()
On Error GoTo Err_packing_champ_scorecard_Click
Dim stDocName As String
Dim startVAR As Date
Dim endVAR As Date
Dim pmuVAR As String
Dim umonthVAR As String
DoCmd.OpenForm "rep_vars2", , , , , acDialog
startVAR = Format(Forms!rep_vars2!START_DATE_FRM, "mm/dd/yyyy")
endVAR = Format(Forms!rep_vars2!END_DATE_FRM, "mm/dd/yyyy")
pmuVAR = UCase(Forms!rep_vars2!PM_USER_ID_FRM)
umonthVAR = Format(Forms!rep_vars2!START_DATE_FRM, "mm/yyyy")
CurrentProject.Connection.Execute "outbdChampionshipScorecard" &
startVAR & "," & endVAR & "," & pmuVAR & "," & umonthVAR & ""
stDocName = "Outbd_Championship_Score_Card"
DoCmd.OpenReport stDocName, acPreview
Exit_packing_champ_scorecard_Click:
Exit Sub
Err_packing_champ_scorecard_Click:
MsgBox Err.Description
Resume Exit_packing_champ_scorecard_Click
End Sub
I'm using Access 2003 with SQL Server 2000.
I keep getting an error: Line 1: Incorrect syntax near '/'. When I
try to execute a stored procedure from a button. Basically what I'm
doing is running a stored procedure, and dumping the output to a temp
table that I've built and calling the report afterwards to run off
that data.
Here's the code for the button. I've tried to use single ' ' around
the variables that have the dates, but that doesn't seem to work
either.
Any help would be appreciated !
Private Sub packing_champ_scorecard_Click()
On Error GoTo Err_packing_champ_scorecard_Click
Dim stDocName As String
Dim startVAR As Date
Dim endVAR As Date
Dim pmuVAR As String
Dim umonthVAR As String
DoCmd.OpenForm "rep_vars2", , , , , acDialog
startVAR = Format(Forms!rep_vars2!START_DATE_FRM, "mm/dd/yyyy")
endVAR = Format(Forms!rep_vars2!END_DATE_FRM, "mm/dd/yyyy")
pmuVAR = UCase(Forms!rep_vars2!PM_USER_ID_FRM)
umonthVAR = Format(Forms!rep_vars2!START_DATE_FRM, "mm/yyyy")
CurrentProject.Connection.Execute "outbdChampionshipScorecard" &
startVAR & "," & endVAR & "," & pmuVAR & "," & umonthVAR & ""
stDocName = "Outbd_Championship_Score_Card"
DoCmd.OpenReport stDocName, acPreview
Exit_packing_champ_scorecard_Click:
Exit Sub
Err_packing_champ_scorecard_Click:
MsgBox Err.Description
Resume Exit_packing_champ_scorecard_Click
End Sub