Add New event?

G

GZ

Hi, On an automatically created form, there are data navigation buttons.
Click the one with >* (or > when already on the last record) will allow "add
new" record. I need write some code before "add new" event such as to
provide an formatted and numbered ID. I am just wondering which event I can
put the code?

I have put the code in "Form_BeforeInsert", but it only works on form load,
not when user tries to add new.

Thanks!

GZ
 
G

Graham Mandeno

Hi GZ

Form_BeforeInsert will only fire when the new record is made dirty, for
example by the user typing the first character in a textbox.

Use Form_Current with an If statement:
If Me.NewRecord Then
...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top