Hi Friends,
I am trying to add a record to a child database depending on what the user sees in the combo.
Once the user determined a record should be added the AddTaskBttn is pressed.
While the following function adds the serial number to the database when the form is filled out an error message tells me that the record can't be saved because the serial number is null. I have tried to use the doevents but i did't got the appropriate result . Please anyone help.
see the code i use
Private Sub AddTaskBttn_Click()
Dim intX As Integer
Dim Sn As String
Sn = Me.CmbTaskList.Column(0)
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert Into Tasklist( SerialNumber ) Select '" & Sn & "' As Expr;"
DoCmd.SetWarnings True
DoCmd.OpenForm "Task", , , "[TaskList.SerialNumber] =" & "'" & Me.cmbSerialNumber.Column(0) & "'", acFormAdd, acDialog
For intX = 1 To 200
Forms!Task!MailingDate_Label.Caption = "Doing something " & intX & " "
DoEvents
Next intX
DoCmd.Close acForm, "Task"
End Sub
Bookmarks