Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a filter using double precision numbers

Status
Not open for further replies.

memberFDIC

Programmer
Jan 22, 2009
10
US
I am trying to create a filter where the criteria are numbers, not text strings. So far, I have been unsuccessful. I keep getting "Type 13 Mismatch" errors in my VBA code when line execution reaches the following:

Me.Results.Form.Filter = "PROJECTEASTING > " & (CDbl(TextStringProjectEasting) - CDbl(TextStringDistance))

I have tried various string formatting tweaks, such as the one below, but still I have no success:

Me.Results.Form.Filter = "(PROJECTEASTING > " & (CDbl(TextStringProjectEasting) - CDbl(TextStringDistance)) & ")"

In the above, PROJECTEASTING is a double precision number and corresponds to a field in my table.
 
>> Where does TextstringProjectEasting come from

It is defined at the opening of the form as a TextString and then gets its value from user input from a text box.
 
Can you confirm that Results is a subform and the code is running in the main form?

The Microsoft: Access Modules (VBA Coding) forum has an FAQ on how to debug your code. You should learn how to do this so you can determine what is happening in your code.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top