Setting values in forms

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
 
S

Steve Schapel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top