Unbound Text Box has quotes when populated

  • Thread starter AkAlan via AccessMonster.com
  • Start date
A

AkAlan via AccessMonster.com

I have a pop up form with an unbound Text Box called txtCurrentMeterReading.
When I open the form I push into txtCurrentMeterReading an integer value
which I grab from the current form but some how there are quotes around the
value which isn't seen on the form, only when I try and run VBA code and
compare the Text Box value to another Text Box. So lets say I push 100 to the
txtCurrentMeterReading Box and the user inputs 99 into another Text Box. When
the code runs it reads If 99 < "100" Then ....
The problem is that because of the quotes, the comparison never sees that 99
is in fact less than 100 and I never get into my Then statement. I don't
understand why the quotes were added to the field in the first place. Here is
the code I used to push the value

DoCmd.OpenForm "frmMeterHourUpdate"
Forms!frmMeterHourUpdate.txtCurMeterHours = Me.MeterReading

Any help is appreciated. Thanks.
 
H

halfbodyguy

It looks to me like it is Dimming it as a String, try declaring that
the whatever you call the "100", when it is being grabbed, it also has
a Dim xxx As Integer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top