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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add numbers not concatenate them

Status
Not open for further replies.

rosieb

IS-IT--Management
Sep 12, 2002
4,279
GB
I want to open a form to find addresses based on grid references within a range. I have 3 unbound text boxes, all with a general number format txtEastSrch, txtNorthSrch and txtENRange.

My code is
stLinkCriteria = "[Easting]>" & (Me![txtEastSrch] - Me![txtENRange]) & "and [Easting]<" & Format(Me![txtEastSrch], "general number") + Format(Me![txtENRange], "general number") & "and [Northing]>" & (Me![txtNorthSrch] - Me![txtENRange]) & "and [Northing]<" & Format(Me![txtNorthSrch], "general number") + Format(Me![txtENRange], "general number")

When I run this, the minuses work fine but the pluses concatenate. If I replace Me![txtENRange] with a number, it works fine.

I'm obviously overlooking something


Rosie
"Never express yourself more clearly than you think" (Niels Bohr)
 
Got it - CDbl function rather than Format.

Rosie
"Never express yourself more clearly than you think" (Niels Bohr)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top