Form Title Bar

R

Raj

Hi,
I have a database that is used to enter orders. I would like to add the
current order that is being worked to the form Title Bar. I am hope that
someone will be able to help..
Thanks in advance
 
K

Klatuu

The property you want is the Caption. Use the Current event of the form to
change it to the current order for existing records. The example below has
made up names, use your own:

Me.Caption = Iif(Me.NewRecord, "New Order", Me.txtOrderNumber)

Also, you will need to put something similar in the After Update event so
when an order number has been entered for a new record, it will be displayed
in the Caption.

Me.Caption = Nz(Me.txtOrderNumber, "None")

I put the Nz in there so if a user deletes the order number, it will not get
an Invalid Use of Null error. Instead it will say None. If you want
something different for this case, change None to whatever you want.
 
R

Raj

Works Great!!
THANK YOU!!

Klatuu said:
The property you want is the Caption. Use the Current event of the form to
change it to the current order for existing records. The example below has
made up names, use your own:

Me.Caption = Iif(Me.NewRecord, "New Order", Me.txtOrderNumber)

Also, you will need to put something similar in the After Update event so
when an order number has been entered for a new record, it will be displayed
in the Caption.

Me.Caption = Nz(Me.txtOrderNumber, "None")

I put the Nz in there so if a user deletes the order number, it will not get
an Invalid Use of Null error. Instead it will say None. If you want
something different for this case, change None to whatever you want.
 
Top