I have a form with cmd button on it that inserts value in a table. Is there a way to have the value in the same record the form creates when submitted. As it stands now 2 records are created one from the form and one from the cmd button. I need to input the values in the same record.
here's the code from the cmd button.
All help will be greatly appreciated !!
here's the code from the cmd button.
Code:
Private Sub Command36_Click()
On Error GoTo Err_Command36_Click
For Each num In List37.ItemsSelected
var = var & List37.ItemData(num) & "_"
Next
If Len(var) > 0 Then
DoCmd.RunSQL "insert into Orders (Custom_Ingedients) values ('" & Left(var, Len(var) - 1) & "')"
'MsgBox var
End If
Exit_Command36_Click:
Exit Sub
Err_Command36_Click:
If (Err = ERR_OBJNOTEXIST) Or (Err = ERR_OBJNOTSET) Then
Resume Next
End If
MsgBox Err.Description
Resume Exit_Command36_Click
End Sub