calculated control problem

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

Guest

Hi,

Thanks to anyone who can help.

I want to calculate a textbox based on a value in the third column of a
combo box also in the same form. I tried (for example) a control source of

=[a_Text]*[b_Combo].column(2)

which, after tabbing to the next field, Access 2007 changed to

=[a_Text]*[b_Combo].[column](2)

but the field just displays #Name?
 
What is the name of the text box where you are using this expression? If
it's a_Text then you have a circular reference and you should change the
name of the text box..

Try breaking down the expression to find which part is causing the problem.
For example, does this work:

=[a_Text]

Or this:

=[b_Combo]

Or this:

=[b_Combo].[column](2)

Another tip: Access gives you very little help with bad expressions in
calculated controls. If you wrap the expression in a function in the form's
module then you will get a much more helpful error. For example (assuming
that your function returns an integer, change if necessary):

Private Function SomeResult() As Integer
SomeResult = [a_Text]*[b_Combo].[column](2)
Exit Function

Then the text box's control source becomes:

=SomeResult()
 
Back
Top