continuous subform & set value

  • Thread starter Thread starter r
  • Start date Start date
R

r

How can I set the value of a field in a continuous subform for just the
current record, and not all of them??
 
r said:
How can I set the value of a field in a continuous subform for just the
current record, and not all of them??


For a bound control, just set its value.

If it's an unbound control, you can not do it in any
straightforward way.
 
I was just about to ask the same question!

What's the non-straightforward way? I have thought of temporary tables, or
perhaps the best answer is a small pop-up form, maybe triggered by
double-clickimg the text box. I am trying to input a Gross value to a
continuous form, and, based on a tax rate, calculate the tax and nett values
(the two I want to store).
 
Your question is somewhat ambiguous.

In one sense, it sounds like you want to save a calculated
value in a table. In this case, the stock answer is that
you should not save calculated values (just recalculate as
needed). But, this might be one of the situations where
it's the right thing to do. If it is, then you should use
VBA to calculate the value and set the bound text box.

OTOH, if you only want to display the calculated value
without saving it to the table, then you can use a text box
expression.

It does not sound like you are trying to use VBA to set an
unbound text box to a value that can not be calculated from
other values in the record. This is the situation that
requires a very roundabout approach.
 
Back
Top