how to set dual control sources

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

Guest

On Access Forms, how can I set (control source) of an object to more than one
source (e.g. a field in a table as well as an expression).
I want to automate a couple of fields on a fomr to show certain values at
certain situations but also be able to edit the content if I need to.
 
You can't set the source of a control to two things
simultaneously.

You could have two controls, one set to your expression and
the other set to your field, then set the .Visible property
in code of the controls to hide or display them as you wish.
That would be easier than switching the source of the
control in code.

The crux of it is deciding what your criteria are for
hiding/displaying the controls (and using that for an If...
Then or Case... Select) and when to apply the criteria (in
what event on the form).

--
Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp is now Free
http://www.mrcomputersltd.com/ Repairs Upgrades

In Asar typed:
 
On Access Forms, how can I set (control source) of an object to more than one
source (e.g. a field in a table as well as an expression).
I want to automate a couple of fields on a fomr to show certain values at
certain situations but also be able to edit the content if I need to.

You can't, as Nick says.

What you could do instead is use a control bound to the field, and
"push" the calculated expression into the field in the AfterUpdate
event (or events) of the controls upon which the value depends.

John W. Vinson[MVP]
 
Back
Top