CHAOSinACT
Registered User.
- Local time
- Today, 19:41
- Joined
- Mar 18, 2009
- Messages
- 235
ok. i have code doing lots of stuff, i've include the offending script to be as clear as possible. Here is the problem: code comes up with an error: "Error Type: Update or CancelUpdate without AddNew or Edit" Prob is i'm NOT UPDATING A RECORDSET!! and it doesn't stop and debug i had to step through it to find the offending line. this is a first for me....
here is the code that halts:
Public Sub SubmitVariance()
On Error GoTo handleError
Dim VariPath As String
Dim rstCivilProjectsTable As DAO.Recordset
Dim rstCivilProjectsTableFiltered As DAO.Recordset
Set rstCivilProjectsTable = CurrentDb.OpenRecordset("tblDGroupCivilMinorJobs")
rstCivilProjectsTable.Filter = "[Civil Job Number] = " & Forms!frmProjectVariancesNotInvoicedDetail!ProjectNumber
Set rstCivilProjectsTableFiltered = rstCivilProjectsTable.OpenRecordset
'get dir if varibin undefined
If IsNull(rstCivilProjectsTableFiltered!VariationsBin) Or rstCivilProjectsTableFiltered!VariationsBin = "" Then
VariPath = BrowseDirectory("Define Variations Directory for Job:")
rstCivilProjectsTableFiltered!VariationsBin = VariPath
Else
VariPath = rstCivilProjectsTableFiltered!VariationsBin ''''''<<<<<<stops on this!!!! i'm just pulling info not updating anything~!!!
End If
'export the pdf
DoCmd.OutputTo acOutputReport, "rptVaritionLodgement", acFormatPDF, VariPath & "\Variation No " & Forms!frmProjectVariancesNotInvoicedDetail!txtVariNumber * ".pdf"
'send the mail
DoCmd.SendObject acSendReport, "rptCivilMinorJobsSimpleAllActive", _
"PDFFormat(*.pdf)", EmailTo, "D-Group Variation Approval", _
"This Variation to Contract has been submitted for your approval.", _
True
ExitHere:
rstCivilProjectsTable.Close
rstCivilProjectsTableFiltered.Close
Set rstCivilProjectsTable = Nothing
Set rstCivilProjectsTableFiltered = Nothing
Exit Sub
handleError:
MsgBox "Error Type: " & Err.Description
GoTo ExitHere
End Sub
it just makes no sense to me(look at the code i've shown where it stuffs out). I'm not updating the record set just pulling info...
here is the code that halts:
Public Sub SubmitVariance()
On Error GoTo handleError
Dim VariPath As String
Dim rstCivilProjectsTable As DAO.Recordset
Dim rstCivilProjectsTableFiltered As DAO.Recordset
Set rstCivilProjectsTable = CurrentDb.OpenRecordset("tblDGroupCivilMinorJobs")
rstCivilProjectsTable.Filter = "[Civil Job Number] = " & Forms!frmProjectVariancesNotInvoicedDetail!ProjectNumber
Set rstCivilProjectsTableFiltered = rstCivilProjectsTable.OpenRecordset
'get dir if varibin undefined
If IsNull(rstCivilProjectsTableFiltered!VariationsBin) Or rstCivilProjectsTableFiltered!VariationsBin = "" Then
VariPath = BrowseDirectory("Define Variations Directory for Job:")
rstCivilProjectsTableFiltered!VariationsBin = VariPath
Else
VariPath = rstCivilProjectsTableFiltered!VariationsBin ''''''<<<<<<stops on this!!!! i'm just pulling info not updating anything~!!!
End If
'export the pdf
DoCmd.OutputTo acOutputReport, "rptVaritionLodgement", acFormatPDF, VariPath & "\Variation No " & Forms!frmProjectVariancesNotInvoicedDetail!txtVariNumber * ".pdf"
'send the mail
DoCmd.SendObject acSendReport, "rptCivilMinorJobsSimpleAllActive", _
"PDFFormat(*.pdf)", EmailTo, "D-Group Variation Approval", _
"This Variation to Contract has been submitted for your approval.", _
True
ExitHere:
rstCivilProjectsTable.Close
rstCivilProjectsTableFiltered.Close
Set rstCivilProjectsTable = Nothing
Set rstCivilProjectsTableFiltered = Nothing
Exit Sub
handleError:
MsgBox "Error Type: " & Err.Description
GoTo ExitHere
End Sub
it just makes no sense to me(look at the code i've shown where it stuffs out). I'm not updating the record set just pulling info...