DAO Edit Mode

  • Thread starter Thread starter Gerard
  • Start date Start date
G

Gerard

Hey all,
I am using SQL 2k on Win 2k with Access 2k as a front
end for the forms. I have a form that is using bound
controls, populated from a query. All I need to know is
how/where to see the DAO Recordset.EditMode property.
Every procedure (Form_BeforeUpdate, etc...)I try to
trap .EditMode, it is always 0. What I really need to
know is when the form is adding a record, vs. editing the
record. Any help is greatly appreciated. Thanks in
advance,

Gerard
 
Hi Gerard,

Try using the NewRecord property of the form instead. It will be true only
on a new record.

If me.Newrecord then
msgbox "It's a new record!!"
endif
 
It sounds to me that you only need to check the NewRecord Property
(returning a Boolean value) of the Form. If it is True, the Form is in
"Add" mode. Something like:

If Me.NewRecord = True Then
' Form is in "Add" mode
....
 
Gerard said:
I am using SQL 2k on Win 2k with Access 2k as a front
end for the forms. I have a form that is using bound
controls, populated from a query. All I need to know is
how/where to see the DAO Recordset.EditMode property.
Every procedure (Form_BeforeUpdate, etc...)I try to
trap .EditMode, it is always 0. What I really need to
know is when the form is adding a record, vs. editing the
record. Any help is greatly appreciated. Thanks in
advance,


Forms have a NewRecord property that you ca use for this
purpose.
 
Sandra,
Thank you sooo much!!!! This was one of those duh
moments. Once I saw the answer, it was obvious. Thanks
so much, this completes my project. Here is a box of
recycled bits to thank you ;)

Thanks,
Gerard
-----Original Message-----
Hi Gerard,

Try using the NewRecord property of the form instead. It will be true only
on a new record.

If me.Newrecord then
msgbox "It's a new record!!"
endif


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Hey all,
I am using SQL 2k on Win 2k with Access 2k as a front
end for the forms. I have a form that is using bound
controls, populated from a query. All I need to know is
how/where to see the DAO Recordset.EditMode property.
Every procedure (Form_BeforeUpdate, etc...)I try to
trap .EditMode, it is always 0. What I really need to
know is when the form is adding a record, vs. editing the
record. Any help is greatly appreciated. Thanks in
advance,

Gerard


.
 
Oh My - no one has ever given me recycled bits! How thoughtful!!

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Sandra,
Thank you sooo much!!!! This was one of those duh
moments. Once I saw the answer, it was obvious. Thanks
so much, this completes my project. Here is a box of
recycled bits to thank you ;)

Thanks,
Gerard
-----Original Message-----
Hi Gerard,

Try using the NewRecord property of the form instead. It will be
true only on a new record.

If me.Newrecord then
msgbox "It's a new record!!"
endif


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Hey all,
I am using SQL 2k on Win 2k with Access 2k as a front
end for the forms. I have a form that is using bound
controls, populated from a query. All I need to know is
how/where to see the DAO Recordset.EditMode property.
Every procedure (Form_BeforeUpdate, etc...)I try to
trap .EditMode, it is always 0. What I really need to
know is when the form is adding a record, vs. editing the
record. Any help is greatly appreciated. Thanks in
advance,

Gerard


.
 
Back
Top