Solved

convert record to integer

Posted on 2013-05-23
1
220 Views
Last Modified: 2013-05-23
In VB6 I have pulled up a recordset from a database.  The first record marked by rec.Fields(0) has a datatype which is a string.  How do I convert it to an integer?

If rec.Fields(0) = 5 Then
 'code goes here
End If
0
Comment
Question by:al4629740
1 Comment
 
LVL 20

Accepted Solution

by:
dsacker earned 500 total points
ID: 39191534
If you are absolutely sure it will always contain a numeric value, then:

If CInt(rec.Fields(0)) = 5 Then
    ' code goes here
End If
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now