Delete Records without Prompt

djossh

Registered User.
Local time
Today, 21:27
Joined
Oct 19, 2011
Messages
89
Hi I have a main form for data entry.. on lost focus a popup form (Modal) opens then I need to enter some data. after that is a button to close the popup form.. then... I want my main form to set a new record.. but it was adding the data that was retained when I opened my popup form.. so I tried to look for a code that will delete it.. but I dont want the warning message to show.. how to do this.. I have a sample code but does not work....Thanks

Private Sub Form_Unload(Cancel As Integer)
DoCmd.OpenForm "FrmPayroll"
DoCmd.SetWarnings False
Me.Undo
DoCmd.SetWarnings True
DoCmd.GoToRecord , , acNewRec
End Sub
 
So your popup form prompts for the data that was missing from the first form? Then, assuming the user enters the necessary data on that popup form, they click a button and the record gets added? If I've got that part right, then it sounds like that was the expected action.

If I understand your question, you want to start a new record, but the information from the last record is populating in the current form? If so, just do something like me.txtField.Value = null.
 

Users who are viewing this thread

Back
Top Bottom