Completing formula in text box

Gavx

Registered User.
Local time
Today, 18:21
Joined
Mar 8, 2014
Messages
155
Is there any way I can configure a text box so that I can enter a formula in it and the result can be displayed/written?

For example say I want to put in the text box 179+11 and want the result to display as well as being written to the db. Sort of like an excel cell.

thanks
 
use Eval(textbixName)
 
And how would I use this statement?
 
The problem is going to be the 'being written to the db' part.

Access is not going to let you enter 179+11 into a Control that is Bound to a Field that is defined as a Number...the Field would have to be defined as Text.

You could then use

Code:
Private Sub txtName_AfterUpdate()
  Me.txtName = Eval(Me.txtName)
End Sub

as arnelgp suggested.

This would be fine if you never have to use this 'Number' for any calculations, elsewhere in the database. If you do, you'd have to Convert the Text to a Number, using one of the Type Conversion Functions, such as CInt(expression) or
CDbl(expression).

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom