D
dfeigen115
I have a form that is used to edit a specifc row of data. the row is selected
based on input criteria passed from another form. The user optionally
updates multipl fields on the form. The form fields are independantly
evaluated for "not null" values and if not null, a sql "update" statement is
used to apply the changes to the row. A copy of the update code follows:
If Not IsNull(Me.MPMImpPlanDt) Then
mpmimp = FormatDateTime(Me.MPMImpPlanDt, vbShortDate)
strSQL0 = "UPDATE cacrdescription SET cacrstatus = 'implementing',
mpmimpplanwho = '" & Me.MPMImpPlanWho & "', mpmimpplandt = '" & mpmimp & "'
where (Cacrdescription.CACRNumber = " & Me.CACR_number & ");"
MsgBox (strSQL0)
DoCmd.RunSQL strSQL0
End If
After all of the optional fields are evaluated and updated, the form is
closed using the statement:
DoCmd.Close acForm, "cacrroutingentry"
The close form is causing an extra incomplete record to be added to the table.
I need to suppress the extra record from being added, when the form is being
closed.
Thanks in advance,
Dan
based on input criteria passed from another form. The user optionally
updates multipl fields on the form. The form fields are independantly
evaluated for "not null" values and if not null, a sql "update" statement is
used to apply the changes to the row. A copy of the update code follows:
If Not IsNull(Me.MPMImpPlanDt) Then
mpmimp = FormatDateTime(Me.MPMImpPlanDt, vbShortDate)
strSQL0 = "UPDATE cacrdescription SET cacrstatus = 'implementing',
mpmimpplanwho = '" & Me.MPMImpPlanWho & "', mpmimpplandt = '" & mpmimp & "'
where (Cacrdescription.CACRNumber = " & Me.CACR_number & ");"
MsgBox (strSQL0)
DoCmd.RunSQL strSQL0
End If
After all of the optional fields are evaluated and updated, the form is
closed using the statement:
DoCmd.Close acForm, "cacrroutingentry"
The close form is causing an extra incomplete record to be added to the table.
I need to suppress the extra record from being added, when the form is being
closed.
Thanks in advance,
Dan