detecting the openform mode in VBA (1 Viewer)

bertiespiv

New member
Local time
Today, 03:28
Joined
Jan 8, 2009
Messages
5
Seems other people are trying to acheive the same thing but from different angles. i also am combining an ADD/Amend form to avoid code duplication etc. I am trying to do it by simply detecting in what mode from the switchboard my form has been opened ADD or EDIT. Anybody any ideas on how you can determine in what mode the form has been opened?

cheers
BS
 

ajetrumpet

Banned
Local time
Yesterday, 21:28
Joined
Jun 22, 2007
Messages
5,638
You can check these properties of any form in code:

*allow Additions/Edits/Deletions

The value of those properties are either TRUE or FALSE. Example:
Code:
if forms("formname").allowadditions = FALSE then
  msgbox "The form is open in EDIT mode"
else
  msgbox "The form is open if ADD mode"
 

Users who are viewing this thread

Top Bottom