A "Add Person" command doesn't.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

frmPerson is based on qryPerson
'Add Person' has following code, which does update tblPeople--by overwriting the first record
How do I get it to generate a new record

Private Sub cmdAddPerson_Click(
On Error GoTo Err_cmdAddPerson_Clic
DoCmd.GoToRecord , , acNewRe
'make everything visible

DoCmd.Requery qryPeopleAddNe
Exit_cmdAddPerson_Click
Exit Su

Err_cmdAddPerson_Click
MsgBox Err.Descriptio
Resume Exit_cmdAddPerson_Clic

End Su
 
If you want to 'goto' a new record so the user can enter it then you just
remove the docmd.requery statement. Is this what you want or are you trying
to programmatically create the record?
 
When I just had the 'goto new record' command, I got a blank record into which I could enter data--but it didn't get entered into the table. It evaporated after entry.
 
Yes, I checked the table.
I'm now have 2 command buttons, one does "DoCmd.GoToRecord,,acNewRecord" bit
The 2nd would run an update query.
Currently the update query is complaining about not having "orgID" (it does have it)
 
Ok is the first button working now?

Post the SQL for the query on the second button - also post the code that
executes the query along with any other description of what is on the form
and where it originates (what table etc.).
 
I've solved this one by creating a special "add person" form based on tblPeople which works. Used the wizard to create the code behind the button.
 
Back
Top