Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 19th, 2003, 08:38 AM
Authorized User
 
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert a variable

Does anyone know how to convert a variable from string to integer?

I have one table that a field is a text field, and I need to use that field to do a "Find First" on another table, but the problem is the second table's field is an integer. So I need to convert the variable first.

Any ideas?

John
__________________
John
 
Old September 19th, 2003, 10:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

John,

Use the CINT function. For example,

Code:
Dim strX as String, intX as Integer

strX = "12"
intX = CInt(strX)

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a string into a variable jtrifts VBScript 4 February 21st, 2008 09:08 AM
storing Javascript variable to ASP variable rupen Classic ASP Basics 5 April 10th, 2007 07:06 AM
ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE SOMANATHAN10 XSLT 1 February 21st, 2007 04:26 AM
Object variable or with block variable not set netfresher VS.NET 2002/2003 0 July 10th, 2006 02:44 AM
Convert variable to boolean stephanel Javascript How-To 2 June 25th, 2003 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.