Jm Sween
Jm Sween

Reputation: 61

VBA - Textboxes concatenate instead of add values

I have an Access Form that requires the mathematical addition of various values in about 20 text boxes. The problem I'm having is that the first two cause the total to concatenate the values in the boxes as opposed to adding them. If I remove the first two text boxes from the equation, the results are correct. Does anyone have nay ideas as to why this happens?? Thanks.

Upvotes: 0

Views: 392

Answers (1)

Probably the values are of type String.

Try to cast them to double with CDbl(first text box value) + CDbl(second) + ...

Upvotes: 3

Related Questions