Opening forms and setting captions.

M

Mike Green

Hi All
I am opening the same form but in different states i.e Read Only, Edit and
Add New. using Event Procedure from three different command buttons. Is it
possible to change the caption of the form being opened to remind the user
which state the form was opened in? If so can someone please point me in
the right direction of how this is achieved?

Regards to all

Mike
 
R

Rick Brandt

Mike said:
Hi All
I am opening the same form but in different states i.e Read Only,
Edit and Add New. using Event Procedure from three different command
buttons. Is it possible to change the caption of the form being
opened to remind the user which state the form was opened in? If so
can someone please point me in the right direction of how this is
achieved?

In the form's Open event...

If Not Me.AllowEdits Then
Me.Caption = Me.Caption & " (Read Only)"
ElseIf Me.DataEntry Then
Me.Caption = Me.Caption & " (Add New)"
Else
Me.Caption = Me.Caption & " (Edit)"
End If
 
C

Craig

Mike,

After you have opened your form add code for changing your form caption:
forms("myform").caption="Read Only"
 
Top