Setting values in forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form which has various fields

Sample Number Autonumber text box
BatchNumber Combo Box
Other fields Straight text boxes

I need a command button which when clicked will create a new record (I am ok
to this point), and put the same batch number into the new record as was in
the previously viewed record. Have tried a macro using set value but this
just returns the first batch number created.

Any thoughts as to whether I am going about this right and if not what
other solutions are there.

Many Thanks

Richard
 
Richard,

Depends a bit on what version of Access you are using. If you are using
Access 2007, you could use the SetTempVar action.

Otherwise, here is another possible approach via macros...
On the After Update event of the BatchNumber combobox, you could use a
SetValue action to set the value of the Tag property of BatchNumber to
the value in the control. And then, with your new record command
button, SetValue again to apply the Tag back to the combobox value.

And yet another idea... Again using SetValue, on the After Update event
of the combobox, to set the value of the Default Value property of the
control.
 
Back
Top