Tupacmoche
Registered User.
- Local time
- Today, 10:43
- Joined
- Apr 28, 2008
- Messages
- 291
Hi All,
I have this run time error that is strange. I say this because the error is occurring in my development environment but not in my production environment and the code is exactly the same. As, I add new features, I move this copy into the production folder for users to use. In fact, I have backup copies that work fine which is true of the production version and the development version. Here is the code has anyone seen this type of error and know how to fix it and what causes it? Also, I can't just use a copy of the dev backup since they are not exactly in sync with changes that I have made. I should also mention that they are running in the exact same environment and machine. Everything is the same for both versions.
Private Sub btnCS_Click()
Dim strSQL As String
Dim strCn As String
'***********VALIDATES THAT FOUR REQUIRED FIELDS ARE ENTERED TO CREATE SCHEDULE********************************'
If ValPaySch() = False Then
MsgBox "You must fill in all four required values to create a schedule!.", vbRetryCancel + vbExclamation
Exit Sub
Else
End If
'*************************************************************************************************************'
strCn = "ODBC;Description=BIRWCDCPVM001;DRIVER=SQL Server;SERVER=BIRWCDCPVM001;Trusted_Connection=Yes;APP=2007 Microsoft Office system;"
strSQL = "usp_EgatePledgeSchedule " & Me.PledgeAmount.Value & ", " & Me.txt_strHMP & ", '" & _
Format(Me.txt_strSD, "yyyy-mm-dd") & "', '" & Me.txt_strFreq.Value & "', " & Me.GiftID & ";"
With CurrentDb.CreateQueryDef(vbNullString)
.Connect = strCn
.SQL = strSQL
.ReturnsRecords = False
.Execute dbFailOnError
End With
Me.tblPledgePayments_subform.Requery
MsgBox ("Pledge Schedule added!")
Me.btnCS.Enabled = False
Call ClearTxtBoxes
End Sub:banghead:
I have this run time error that is strange. I say this because the error is occurring in my development environment but not in my production environment and the code is exactly the same. As, I add new features, I move this copy into the production folder for users to use. In fact, I have backup copies that work fine which is true of the production version and the development version. Here is the code has anyone seen this type of error and know how to fix it and what causes it? Also, I can't just use a copy of the dev backup since they are not exactly in sync with changes that I have made. I should also mention that they are running in the exact same environment and machine. Everything is the same for both versions.
Private Sub btnCS_Click()
Dim strSQL As String
Dim strCn As String
'***********VALIDATES THAT FOUR REQUIRED FIELDS ARE ENTERED TO CREATE SCHEDULE********************************'
If ValPaySch() = False Then
MsgBox "You must fill in all four required values to create a schedule!.", vbRetryCancel + vbExclamation
Exit Sub
Else
End If
'*************************************************************************************************************'
strCn = "ODBC;Description=BIRWCDCPVM001;DRIVER=SQL Server;SERVER=BIRWCDCPVM001;Trusted_Connection=Yes;APP=2007 Microsoft Office system;"
strSQL = "usp_EgatePledgeSchedule " & Me.PledgeAmount.Value & ", " & Me.txt_strHMP & ", '" & _
Format(Me.txt_strSD, "yyyy-mm-dd") & "', '" & Me.txt_strFreq.Value & "', " & Me.GiftID & ";"
With CurrentDb.CreateQueryDef(vbNullString)
.Connect = strCn
.SQL = strSQL
.ReturnsRecords = False
.Execute dbFailOnError
End With
Me.tblPledgePayments_subform.Requery
MsgBox ("Pledge Schedule added!")
Me.btnCS.Enabled = False
Call ClearTxtBoxes
End Sub:banghead: