AddNew method

arage

Registered User.
Local time
Today, 11:30
Joined
Dec 30, 2000
Messages
537
AddNew method
Am I correct in understanding that if a user clicks the add new record button on my form, the best way to provide a message box on this single event is through the addNew method? But which event would I place such code, maybe in onCurrent? Recordsets and modifying them is a new thing to me. Please advise.
 
Events allow you to detect and react to particular circumstances.
Methods are actions you can apply to objects.
So a methods can never provide you ways to detect and react to users actions.

AddNew is a method that applies to recordsets, which are... sets of records, just like tables, or records returned by a query. AddNew adds a new record to a recordset.
So it is not what you are looking after.

If you want to react when a user clicks on the Add new button of your form, either make you own buttons (so you can catch the On_Click event) or use the On_Current event AND test if the record is new through the NewRecord property:

If Me.NewRecord then Msgbox "You re in a new record".

Alex

[This message has been edited by Alexandre (edited 02-26-2002).]
 
Couldn't you just add Msgbox "You're about to add a new record" to the Click event for the add button?
 

Users who are viewing this thread

Back
Top Bottom