Using if - should be simple

Apologies as this make be very simple but I rarely get to play around in notes !! I a trying to create a formula that does the following.

If Sam open the from it updates the department field to sales, if Fred opens the form it defaults the deparment field to Accounts - without them having to pick from a list.

I’m trying to use this formaula but excuse my errors as I only use notes developer now and then…

@If(me = “Fred/HHY/ABC” ;Department = “Accounts”;Department = “Sales”)

Many Thanks

Stefan

Subject: Using if - should be simple

How about using @SetField.From the Designer help:

FIELD Status:=Status;

@If(Priority=“Low”|Priority=“Medium”;@SetField(“Status”;“Closed”);

@SetField(“Status”;“Open”))

You could adapt that for yours?

Subject: RE: Using if - should be simple

Thanks very much - works a treat !!