ACC2000: change string to int

I have a customer number that is a string, but I need to change it to an 
integer variable. Assigning: iCust = sCust does not work. (I just want 
to drop leading zeroes in the string. It can stay a string if that's 
easy.)

Is there a function to convert string to int? I could not find one in 
Access help. String() seems to convert a numeric to a string data type. 

Thanks.
0
A
1/30/2008 4:54:13 PM
access.reports 4434 articles. 0 followers. Follow

3 Replies
720 Views

Similar Articles

[PageSpeed] 22

Try use:
 Int(sCust)
or
 Val(sCust)

If you want to find Help on these types of functions, first open any module 
and then open Help.

-- 
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP 
http://www.access.hookom.net/UCP/Default.htm


"A Man" wrote:

> I have a customer number that is a string, but I need to change it to an 
> integer variable. Assigning: iCust = sCust does not work. (I just want 
> to drop leading zeroes in the string. It can stay a string if that's 
> easy.)
> 
> Is there a function to convert string to int? I could not find one in 
> Access help. String() seems to convert a numeric to a string data type. 
> 
> Thanks.
> 
0
Utf
1/30/2008 5:06:02 PM
Val(String) will return the value of the string; however it does return zero 
if the string is just spaces and will error if the string is null
Val("22.5")

Better testing is
If IsNumeric(String) Then Val(String)

Or you could use
IIF(IsNumeric(String),Val(String),Null)


-- 
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"A Man" <uce@ftc.gov> wrote in message 
news:MPG.220a75beb2bc58159896c6@news.readfreenews.net...
>I have a customer number that is a string, but I need to change it to an
> integer variable. Assigning: iCust = sCust does not work. (I just want
> to drop leading zeroes in the string. It can stay a string if that's
> easy.)
>
> Is there a function to convert string to int? I could not find one in
> Access help. String() seems to convert a numeric to a string data type.
>
> Thanks. 


0
John
1/30/2008 5:11:06 PM
In article <F82F86A6-C3D3-47F4-8E9A-192F817027ED@microsoft.com>, 
duanehookom@NO_SPAMhotmail.com says...
> Try use:
>  Int(sCust)
> or
>  Val(sCust)
> 
> If you want to find Help on these types of functions, first open any module 
> and then open Help.
> 
> 
Oh, THAT'S my problem. I thought all help files in Access were 
integrated so when I did a search, it searched VBA help also.
0
A
1/30/2008 7:09:46 PM
Reply:

Similar Artilces:

Change of recipient/sender display name
Hi All, Environment :- Windows 2003 x64 with exchange 2007 (All in one role) Outlook client :- 2003, 2007 We have created a list of mail contacts (which under GAL) in exchange 2007, these mail contacts are associates with external email address, each of contact has a naming standard for display name, for example, display name is HD Finance Manager, external email address is fin_manager@hdemea.com I want to configure outlook client to show the display name according to mail contacts whenever the email address is match to mail contacts list (GAL), for example, an email sent from the email a...

Change default font format in Excel
I have an existing workbook with cell text entries in regular black font. I want to make a number of additional entries in various cells in this workbook, and I want all my text entries to be a different font format (bold, red). Is there a way to do this automatically without highlighting each entry I make and manually changing the cell format? Thanks. Michael, Copy the code below, right-click on your sheet tab, select "View Code" and paste the code in the window that appears. HTH, Bernie MS Excel MVP Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Cou...

Change <value> in outlook
We Have Exchange 2003 sp2 and outlook 2003 sp2. I have renamed 2 AD accounts. Changed all display names, accounts name etc with the 2 accounts. When users open outlook and send to renamed account they see account name <oldaccountname> in the autocomplete list. I have cleared nk2 files in profile , but it still shows newaccount <oldaccountname> in drop down box. Is there a way to edit the <oldaccountnam> value of the renamed account? I tried the same thing with a freshly loaded PC. with the same result. Thanks You can delete the nickname files. -- Ed Crowley MVP - E...

changing the cell information #2
Hi I have files I tried to change the cell information to another cel that have to be the blank for a row that contains director name in cel A and for the movie titles I have to have director names instead of th title names.Please help me, the data in cell B sholuld have to be, A 1 D:B.Jane 2 T:Back to the future 3 T:Aliens 4 T:X-files 5 D:Adam Mathew 6 T:Core 7 T:Titanic B 1 (empty) 2 D:B.Jane 3 D:B.Jane 4 D:B.Jane 5 (empty) 6 D:Adam Mathew 7 D:Adam Mathew thanks -- Message posted from http://www.ExcelForum.com ...

Change links to hyperlinks in a workbook?
I have 5 Income Statement sheets in a workbook. The first sheet is an Income Statement summing four departments (listed by columns). Column B has Dept 1 data, column C has Dept 2 data, etc. ALL data on this sheet is linked (referenced) to the other four sheets which are the individual departments. I know I can set hyperlinks one at a time, but is there a way for me to have each of those links (every cell containing the data from the other four sheets) become hyperlinks? If I have to add another sheet that mirrors the summary sheet but has hyperlinks, that would be fine. I am just ...

Passing a variable as a parameter value instead of a literal string to a child report?
In the Navigation section (Jump to URL), I have the following: ="javascript:void(window.open('http://localhost/reportserver?/Reports +Folder/My +Report&rs:Command=Render&StartDate=01/01/2009&FinishDate=12/31/2010'))" This works as designed - a new window pops up with the "My Report" report and the StartDate and FinishDate of 01/01/2009 and 12/31/2010 are passed respectively. But what is the syntax for changing the "01/01/2009" and "12/31/2010" to variables that point to the StartDate and FinishDate parameters of the PAR...

Changing Interface OWA (exchange 2003)
Not sure if you all remember but back in the Exchange 5.5 days we use to be able to go onto a site and put in the username of the person mailbox you want to access, then a windows pop up would come up asking you for your credentials. I was wondering if that is still possible to do that in Exchange 2003? If so how can that be done? Configure Forms-Based Authentication (FBA). -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "John" <nospam@comcast.net> wrote in message news:evIllMndHHA.596@TK2MSFTNGP06.phx.gbl... > Not sure...

Forcing String Literal as Wide Character Unicode
Hello, I am under the impression that using _T("...") will convert my string literal to either a char or a wchar depending on what is defined, but I would like to force my string literal to be a Unicode String ( i.e wchar_t ) How would I do that? Would it be something like: wchar_t string[] = "hi"; something like that? Or is there a way to force my literal string to be unicode? "sleeper" <TheFakeJon@gmail.com> wrote in message news:1159489470.136737.259600@b28g2000cwb.googlegroups.com... > Hello, I am under the impression that using _T("...&q...

Change License / Company name
Hi, we tried CRM 1.2 with the MSDN license key. Now my company bought a 25 user Proffesional Suite license and I want to change the key on the production server. Is there an easy way to do this?? The only solution I see, is via the Data Migration Framework. Erik. How about the re-deploy tool? "Erik" <none> wrote in message news:u0SXdbXlEHA.3452@TK2MSFTNGP15.phx.gbl... > Hi, > we tried CRM 1.2 with the MSDN license key. Now my company bought a 25 > user > Proffesional Suite license and I want to change the key on the production > server. Is there an easy wa...

gp10 change clients pointing to different server
In version GP 10 I have clients pointed to a test server. When production server is ready what do i do to point the clients to the production server e.g. GPServer. Would I change the odbc connection? Or Rerun the client installs? Any help is appriciated. Thank YOu As long as your production server has THE SAME level service pack as your clients and THE SAME third party products all you need to do is repoint your ODBC to the production server. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Global Business, LLC http://www.maximumglobalbusiness.com "2020" wro...

Changing the Selection Fields in a Combo Box
Hi, I've created a Combo Box using the Controls Wizard. In creating the control, I specified that my unique value to be stored in the table is an ID. When the user views the selection options in the Combo Box, I'd like to have the ID field hidden and only see the text values, while still storing the ID in the appropriate column. This is probably a second question. Also, when the user views a form that has been populated, I'd like them to see the actual textual values on the form, as just the stored ID value. Is that possible to do with the one Combo Box or is that...

APAY Frequency changes mysteriously
Has anyone noticed that if, for example, you set up an APAY bill monthly, that all of a sudden the next pay date is many months later? It will be cruising along fine, sending bills monthly via MSN Billpay automatically and then one day I go to look at BILLS AND DEPOSITS and some of the autopay's that should be due next month say something crazy like it wont be paid until three months from now or even Jan of next year. I have to cancel the autopay and resubmit it with the proper information. This has happened to me several times in Money2003 on XP... p.s. I tried out the archive feature t...

Background changes conditionally
Hi all, I have a spreadsheet that shows the floor plan layout of my call centre. On each desk, the desk number and identity are displayed. I would like to colour the background for those pcs that are on the same subnet. I have a sheet called data - it contains Table Number, Desk Number, PC ID, IP Address. How could I get it to change the background colour if the pc is on subnet 162, and set a different colour for those on subnet 167 any ideas? -- PeterG ------------------------------------------------------------------------ PeterG's Profile: http://www.excelforum.com/member.p...

Locking cell color while allowing data changes in cell
In excel 2000, I created an attendance worksheet for my classes.(Alphabetized names down left vertical column. Dates across top of horizontal row.) I added a different color to all cells in every other row to make for easier reading of each student's name and absences. Every other row stays with a white background. My question: I wondered if it was possible to lock row colors while allowing data to change on top of them. If a new student is added to my class in alphabetical order, the alternating color pattern is often lost. It is a pain to rechange row and cell colors. Any shortcut ...

OWA & "User must change password at next logon"
Current Environment: Running EX2K3(SP2), and using OWA as the ONLY option to get e-mail; using certificates (https:\\owa.domain.com\exchange) & forms based Authentication. Problem: I create a NEW user in AD; e-mail enable it, and select "User must change password at next logon". Now when the user tries to log in (VIA OWA) s/he is not prompted to change the password / it won't even log them in. It use to work with our old exchange 2000 environment, where it gave them the opportunity to change the password at sign on. Answer: ? There is one property in MetaBase: ...

Changing default Print copies
Hi, I have a workbook that has a worksheet with default printing copies of 3. Even when I go to page setup and change the number of copies to print to 1 it will automatically revert to 3 the next time I bring up the print dialog. I have also looked through the VBA editor at the worksheet for any oddities and have found none. Does anyone know how to change this permanently? Thanks in advance. Pach >Even when I go to page setup and change the number of copies to > print to 1 it will automatically revert to 3 the next time I bring up > the print dialog. Look at the defaults for you...

stop automatically changing formula!
i have a countif function COUNTIF(Locking!I16:I40,"f") when i copy this and paste it to the next cell, the formula automatically change to COUNTIF(Locking!J16:J40,"f") How do I stop it from changing column I to J?!?!?! thanks. Caryn, =COUNTIF(Locking!$I$16:$I$40,"f") or =COUNTIF(Locking!$I16:$I40,"f") HTH, Bernie MS Excel MVP "caryn" <caryn.tan@gmail.com> wrote in message news:d7n4u3$hgi$1@avnika.corp.mot.com... > i have a countif function > COUNTIF(Locking!I16:I40,"f") > when i copy this and paste it to the nex...

HOW DO I COPY FORMULA WITHOUT CHANGING CELL REFERENCE
My cell c1 contains the formula b1-a1.when i copy this formula to cells d1 and e1 the cells d1 and e1 have the following formula : d1=c1-b1 e1=d1-c1 but i want the following d1 should be b2-a2 and e2 should be b3-a3 how do i do this? One way... In C1 enter & copy across: =INDEX($A:$A,COLUMN()-COLUMN($C$1)+1)-INDEX($B:$B,COLUMN()-COLUMN($C$1)+1) anantth wrote: > My cell c1 contains the formula b1-a1.when i copy this formula to cells d1 > and e1 the cells d1 and e1 have the following formula : > d1=c1-b1 > e1=d1-c1 > > but i want the following > d1 should be b2-...

unable to change password via OWA
Hi, I am having a problem with users changing passwords via OWA. When they click on the change password button, it comes up with change password screen and asked for domain name, user name , old password ,etc. The problem that I have is that when I submit it, it comes up with message saying "Either the password is too short or password uniqueness restrictions have not been met." But I didn't define any password policy on DC. What can I do ? Kindly please give me some idea. Thanks Losa If you are running windows and exchange 2003 then there are password requirements that...

prompting to save workbook every time (even when no changes made)
i have 3 workbooks all very similar and every single time i open any o them, even when not changing anything, i am prompted to save th thing. its so bad that i can literally open the workbook then click the clos button straight away and it STILL prompts me to save it because i seems to think something has changed. as far as i can see i dont have any macros or anything that will ru every time it starts and change something (i did have a = today in on cell which kept the date as today but taking this out made n difference -- Message posted from http://www.ExcelForum.com Hi Neowok! You prob...

find match then change cell value
In column A I have cells filled with text and in column B I have cells filled with numbers. I need to check if the number in cell C1 equals any of the numbers in column B. If a match is found then I need to change the text in column A to CBO. e.g. Column A Column B Column C aep 5 7 apa 0 gci 59 xto 5000 xle 7 oih 253 ed 8 Since the cell C1 = 7 equals the 7 from column B, I need to change the data in column A from xle to cbo. Is this possible...

Insert new row as cell contents change
Insert new row as cell contents change. After importing data I have a spread sheet with a column that contains a series of alpha numeric characters. At various random intervals in this column the contents change. EG rows 1 to 4 could contain ABC, then rows 5 to 15 could become 222. I am looking for a method to insert a blank row automatically between the rows were the contents change. Many Thanks Geo George If you are familiar with VBA the code below will do what you want. Preselect the column of data first Sub InsertRowAfterValueChange() Dim myCell As Range Dim sCurrVal As String ...

DAO, Access, zero-length strings?
How can you set that you want to allow zero-length strings in a MS Access database with DAO? Also, how can you set that you want default values? Access doesn't seem to allow "DEFAULT" property... ...

OWA - change password
Getting the "Object Required" error, when somebody is trying to change their password through OWA. (Win2003/Ex FE 2003) Any ideas what could be causing this? TIA! / Per Did you follow the steps in: http://support.microsoft.com/kb/297121 ? -- Pablo D. Vernocchi Microsoft Exchange MVP MCSA + M / MCSE + Sec https://mvp.support.microsoft.com/profile=8E94A6C0-F6D9-4686-96D5-04230CC0141F http://www.itpros.com.ar http://www.msglue.org http://msmvps.com/exchangebloglatino "Per Hagstrom" <per.hagstrom@swic.eduNOSPAM> wrote in message news:Ojo%23EozNHHA.1240@TK2...

OWA changing password
I'm trying to change my password through Options in Outlook Web Access. I get the following error number - 2147023569. Try researching in KB without success. Has anyone run into this problem before? Contact your mail administrator or ask in an Exchange newsgroup as OWA is part of Exchange; not Outlook -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -Backup and Restore -Create an Office XP CD slipstreamed with Service Pack 3 ----- "cathy smyth" <anonymous@discussions.microsoft.com> wrote in message news:1f6d101c45863$6f00b360$a601280a@...