I have a form, used to create and document quotes for parts, that has the AllowEdits property set to No so that once a quote is written it can not be changed.
If the user moves to a new record, I want to change the AllowEdits property to Yes. There is a combo box that the user can use to base the new quote on an existing part number.
I've tried placing Me.AllowEdits= True in several places to mkae the form editable. I keep getting Error 3426 on this line of code: rst1.AddNew
Here is my code:
Private Sub cboLookUpPart_AfterUpdate()
'Map Part's Current Descriptive Data to Quote
'--------------------------------------------
Me.txtPartNumber = Me.cboLookUpPart.Column(0)
Me.txtPartName = Me.cboLookUpPart.Column(1)
Me.txtREV = Me.cboLookUpPart.Column(2)
Me.cboMaterial = Me.cboLookUpPart.Column(3)
Me.cboShape = Me.cboLookUpPart.Column(4)
Me.txtDimensions = Me.cboLookUpPart.Column(5)
Me.txtLenPiece = Me.cboLookUpPart.Column(6)
Me.Refresh
'Map Part's Current Routing to Quote
'-----------------------------------
Dim rst As DAO.Recordset, sfrm As Form, sfrm1 As Form
Set sfrm = Forms![frmQuotes]![subUnionOperations].Form
Set rst = sfrm.RecordsetClone
Set sfrm1 = Forms![frmQuotes]![tblQuoteOps subform].Form
Set rst1 = sfrm1.Recordset
If rst.RecordCount >= 1 Then
rst.MoveFirst
Else
Exit Sub
End If
Do
Me![tblQuoteOps subform].Form![txtQuoteID] = Me![txtQuoteID]
Me![tblQuoteOps subform].Form![txtOperationNumber] = rst![Operation#]
Me![tblQuoteOps subform].Form![txtType] = rst![Type]
Me![tblQuoteOps subform].Form![cboDesc] = rst![Machine]
Me![tblQuoteOps subform].Form![txtSetUpTime] = rst![SetUpTime]
Me![tblQuoteOps subform].Form![txtRunTime] = rst![RunTime]
rst.MoveNext
rst1.AddNew
rst1.Update
Loop Until rst.EOF
End Sub
Any help will be greatly appeciated,
Kopy
If the user moves to a new record, I want to change the AllowEdits property to Yes. There is a combo box that the user can use to base the new quote on an existing part number.
I've tried placing Me.AllowEdits= True in several places to mkae the form editable. I keep getting Error 3426 on this line of code: rst1.AddNew
Here is my code:
Private Sub cboLookUpPart_AfterUpdate()
'Map Part's Current Descriptive Data to Quote
'--------------------------------------------
Me.txtPartNumber = Me.cboLookUpPart.Column(0)
Me.txtPartName = Me.cboLookUpPart.Column(1)
Me.txtREV = Me.cboLookUpPart.Column(2)
Me.cboMaterial = Me.cboLookUpPart.Column(3)
Me.cboShape = Me.cboLookUpPart.Column(4)
Me.txtDimensions = Me.cboLookUpPart.Column(5)
Me.txtLenPiece = Me.cboLookUpPart.Column(6)
Me.Refresh
'Map Part's Current Routing to Quote
'-----------------------------------
Dim rst As DAO.Recordset, sfrm As Form, sfrm1 As Form
Set sfrm = Forms![frmQuotes]![subUnionOperations].Form
Set rst = sfrm.RecordsetClone
Set sfrm1 = Forms![frmQuotes]![tblQuoteOps subform].Form
Set rst1 = sfrm1.Recordset
If rst.RecordCount >= 1 Then
rst.MoveFirst
Else
Exit Sub
End If
Do
Me![tblQuoteOps subform].Form![txtQuoteID] = Me![txtQuoteID]
Me![tblQuoteOps subform].Form![txtOperationNumber] = rst![Operation#]
Me![tblQuoteOps subform].Form![txtType] = rst![Type]
Me![tblQuoteOps subform].Form![cboDesc] = rst![Machine]
Me![tblQuoteOps subform].Form![txtSetUpTime] = rst![SetUpTime]
Me![tblQuoteOps subform].Form![txtRunTime] = rst![RunTime]
rst.MoveNext
rst1.AddNew
rst1.Update
Loop Until rst.EOF
End Sub
Any help will be greatly appeciated,
Kopy