Would Button with lookup formula better than form with lookup formula?

In order to expedite server performance, would it be better for me to create a button, which will do the relevant lookup to the relevant field? current ly I am doing lookup directly at the relevant field. I think this could make the form performance much better, as the lookup will only be done upon clicking the button.

However, I am not quite familiar on the coding, how to assign the lookup formula to several fields in the form. Would really appreciates if anyone would willing to share. I tried to use FieldA:=FieldA, FieldA=@lookup, but don’t think it works.

tq in advance for your assistance.

Subject: Would Button with lookup formula better than form with lookup formula?

I guess it would be quicker, but a couple of lookups won’t necessarily slow down the form to a grinding halt or anything.

As for the button, use the formula below, it includes a bit of error trapping:

tmp:=@dblookup(…);@if(@iserror(tmp);“An error has occurred”;FIELD FieldA:=tmp)

Dan

Subject: RE: Would Button with lookup formula better than form with lookup formula?

TQ for sharing this code, this is much better coding than I used to write.