Two Current Users

B

Bassel

I have a form with two fields. A and B.
I want to store the current user opening the form in these two fields, when
the user presses Command button save.
How to
1-save the current user in field A only, when the command button is pressed
for the first time. Then the form is closed
2-save the current user in field B only when the form is opened again and
the command button is pressed.

Please can you help me solve this problem
 
J

jl5000

Add this code to your button that saves the record:

If isnull(me.A) then
me.A=environ("USERNAME")
end if

me.B = environ("USERNAME")
 
Top