Code:
Private Sub SubmitStatus_click()
On Error GoTo Err_SubmitStatus_Click
[User] = fOSUserName()
' DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'this is a better method to save a record
If Me.Dirty then
Me.Dirty = FALSE
End If
DoCmd.GoToRecord , , acNewRec
Exit_SubmitStatus_Click:
Exit Sub ' << Sub Exits here!!
Err_SubmitStatus_Click:
MsgBox Err.Description
Resume Exit_SubmitStatus_Click
'<<------- NO code below this line will be executed ------->>
'why are these two lines here?????
'DoCmd.RunSQL "INSERT INTO DailyStatusBackend (MasterProjectID)" & "Values(&me.combo14.column(6)&)"
'CurrentDb.Execute strSQL, dbFailOnError
'this is where I have been adding the combobox="" and it doesn't work. Neither does me.combobox.value=null, me.combobox="", etc.
End Sub
1) The code to clear the combo box is in the wrong place.
2) Isn't the combo box name "combo14"?? And Not "combobox"???
AFTER the line "DoCmd.GoToRecord , , acNewRec" try:
Code:
DoCmd.GoToRecord , , acNewRec
Me.combo14 = NULL
or
Code:
DoCmd.GoToRecord , , acNewRec
Me.combo14 = Empty