New Record Fields

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

I am not a very advanced developer so please forgove me if this is a stupid
question.

I have a form which works great, only problem is I don't want the new (empty
ready to be filled in) record at the end of the list of records.

I turned it off in the forms properties, but this also stopped me being able
to add a new record with a button and piece of code.

Is there a way to achieve this?

Thanks
 
Thanks

I tried that and it works. However, it won't turn back off again.

I added a save record button and put AllowAdditions=False as part of that so
it would turn it back off, but nothing happens.

Am I doing something wrong?

Thanks
 
Very simple code at the moment - I will build onto it as we develop it.


Add a new record:

Private Sub cmdAddNewTimeSheetRecord_Click()

AllowAdditions = True

On Error GoTo Err_cmdAddNewTimeSheetRecord_Click

DoCmd.GoToRecord , , acNewRec

Exit_cmdAddNewTimeSheetRecord_Click:
Exit Sub

Err_cmdAddNewTimeSheetRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewTimeSheetRecord_Click

End Sub


Save Record:

Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdSave_Click:
AllowAdditions = False
Exit Sub

Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click

End Sub
 
Back
Top