VB turns text field into real number?

metal

New member
Local time
Today, 13:14
Joined
May 9, 2009
Messages
1
I am adding records in Access in Table View, and I want to change the upcoming record (to be added) with the same values in most fields, to speed input.

So I do this by changing the default value for each field using the ‘Lost_Focus Procedure’ event, something like this:

Procedure Lost_Focus

field.defaultvalue = [field]

End

This works for all fields except one. It is a text field, with a drop=down box, and has pipe size values.

The trouble occurs when the user selects “1-1/2” which means 1.5 inch pipe size, but the Procedure above sets the next record value to 0.5 because 1-1/2 is interpreted as a number expression, not text.

[FONT=&quot]Similarly, the text pipe size “1-3/4” will get changed to 0.25



[/FONT]
 
Hi -

Take a look here.

To conform to your examples, you'll need to change:

intPosition = InStr(strGetNumber, " ")

...to

intPosition = InStr(strGetNumber, "-")

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom