# 5-digit Credit Card Number With Fifth Digit As Check Digit

Apr 6, 2010

I just finished this application where you enter a five-digit credit card number, with the fifth digit being the check digit. everything seems to work except, I can't seem to get it to determine that any number is "valid". Every 5-digit combination that I enter returns "The credit card number is not valid". Im using visual basic 2008 express

[Code]....

## Make A App That Verifies A Five Digit Credit Card Number?

Oct 31, 2011

I need to make a app that verifies a five digit credit card number. The check digit is 5th and is found by multiplying the 2nd and 4th digit. Heres my current

Dim strInput As String
Dim strOutput As String
Dim intSumOfDigits As Integer

[code]....

## Write A Program That Validates An Inputted Ten Digit ISBN Number Using The Check-digit?

Sep 16, 2011

I'm supposed to write a program that validates an inputted ten digit ISBN number using the check-digit at the end to ensure that the sum is a multiple of eleven. Before calculating this and detecting if the entered number is indeed a valid ISBN, we're required to check the first nine digits and see if they are indeed integers. After this the tenth digit is checked to see if it is "X" (for ten) or 0-9.

With the code I've written it keeps returning false for whether or not the ISBN is valid, even with valid numbers. I feel like its something to do with the hyphens; have I misused the replace function?I'm a little lost on how to make my code work, but I'm fairly certain my logic is okay so far.

[Code]...

## VB - Georgetown Credit Card - When The Last 5th Digit Match The Sum Number At The Last Number - Isnt Working

Dec 10, 2010

I got most part correctly but the only part isnt working right is when the last 5th digit match the sum number at the last number.

Private Sub btnVerify_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnVerify.Click
Dim strCardNum As String
Dim strSumNum As String

[CODE]...

## Make A Digit Number In A Field Of A Database Add One Digit Number To It Self?

Aug 12, 2011

i want a button to perform a function of checking the last digit number in a field of a table in and add a digit to it and display it in a textbox.

## SQL : Get Minimum Value From List Of 3, 4, 5 Digit Numbers But Want Minimum 4 Digit Number?

May 4, 2012

I'm using Visual Studio and table adapters using an Access DB as the backend. I need the minimum 4 digit value. I want to get next available 4 or 5 digit number. And this will change depending upon the users request. Currently I use a table adabpter query. But how would I write a query. I suppose I could do a long iterative loop through all values until I see a 4 digit.But I'm trying to think of something more efficient.

Function GetNextAvailableNumber(NumofDigits) as Long
'SQL Code Here ----
'Query Number Table

[code]....

## Convert Single Digit To Double Digit?

May 28, 2011

I'm making a project that randomly picks a number from an array, but if it picks a number less than 10 then the number is a single instead of a double.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim N(2) As Integer
N(0) = "0" & 1
N(1) = "0" & 2
N(2) = "0" & 3

[Code]...

## Make Double-digit Numbers From One-digit?

Apr 22, 2012

Ok, I have like this:

Public basic_numbers(10) As Integer
basic_numbers(0) = 0
basic_numbers(1) = 1

[code].....

## Check Digit Weights?

Nov 6, 2009

i'm trying to calculate the check digit for a scan line. my problem is it needs to be weighted 2121, right to left. so what i have to do is take each character in the string and convert it to it's ASCII equivalent then multiply that by either a 2 or 1 depending on the position of the character. how can i alternate the 2 to a 1 after each character?

Dim Product As Integer
Dim SumOfProducts As Integer

[code]....

## Check The Digit Code?

Apr 27, 2010

I am working on a check digit program and I am having some trouble finding the best path to take. The program requires 5 digits (numbers). I am calling them

num1
num2
num3
num4
num5

My ultimate goal is to use this equation:

num5 = num1 + (num2 *2) + num3 + (num4*2) - but I use the second digit of the resulting number.

Example: number 12346 - would be "correct!"

12345 - would be "wrong!"

1 + (2*2=4) + 3 + (4*2=8) = 16 so the correct would be 12346 When the user puts in the numbers on the UI I will be returning a comment in a text box on the UI.Which direction should I start?

## How To Encrypt 4 Digit Number

Feb 6, 2012

How I could retrieve the single digits of a 4 digit number to manipulate them in my own way to encrypt the 4 digit number to my liking. Here's what I have to do; take a 4 digit number, add 7 to each digittaking the result and dividing by 10 leaving only the remainder. Then swap the first digit with the third, and swap the second with the fourth digit.

## How To Get Next 4 Digit Number From Table

May 4, 2012

I found a good method of getting the next 4 digit number. How to find next free unique 4-digit number..But in my case I want to get next available 4 or 5 digit number.And this will change depending upon the users request. Theses number are not a key ID columns, but they are essential to the tagging structure for the business purpose. Currently I use a table adabpter query. But how would I write a query. I suppose I could do a long iterative loop through all values until I see a 4 digit.[code]Numbers is the List of All available number from 0 to 99999, basically what's available to use. LineList is my final master table where I keep the long and all the relevant other business information.

## Split Three Digit Number?

Feb 17, 2011

I'd like to know how to get VB to display the individual digits of a three digit number when I click a button. Sorry if this seems simple, or if it's in the wrong place.

## ISBN-10 Check Digit Calculating

Sep 3, 2009

I'm trying to calculate the ISBN check digit of a number. First I have to remove all dashes from the ISBN; the rult is a 10-digit interger. For example 0-619-15934-0 becomes 0619159340. Then apply a weight factor to each of the first nine digits and sum the weighted numbers. AThe weight factor is the digit's position in the ISBN. THat is, the first digit is multiplied by 1, the second by 2, etc. Finnally I have to compute the check digit as the mod 11 modulus of this number for example. 209 mod 11 = 0 (i.e., 209/11 = 19, remainder 0_ This is the check digit. If the remainder is 10 ten the check digit is 0. Once the check digit has been calculated, it can be compared to the check digit given with an ISBN to determine if the ISBN is correct, or appended to a new ISBN as its check digit.[code]THe first problem arises when it tells me to make sure I enter all numbers when I should be deleting the dashes and then making sure that the contents are numeric. But even without it and without entering dashes the program still blows up.

## C# - Round Any N-digit Number To (n-1) Zero-digits

Jan 5, 2011

I need to round like this:

12 -> 10
152 -> 200
1538 -> 2000
25000 -> 30000
etc.

Twisting my head, but can't see how to make this. Must work for any n number of digits. Anyone got an elegant method for it?

## Convert A 3 Digit Number To Text?

Nov 1, 2009

I have to do one project like : 1.Complete the code to convert a 3 digit number to Text  (Number > 19) 2.Adding suitable conditional statements modify to code to support the whole range of 3 digit numbers.

## Format - Always Return 2 Digit Number?

Jun 1, 2012

In the function it returns the no in one digit .I want it to always return 2 digit number.Like if it is 0, it should return 00.

Public Function GetHexColor(colorObj As System.Drawing.Color) As String
Return Hex(colorObj.R) & Hex(colorObj.G) & Hex(colorObj.B)
End Function

## How To Detect A Two Digit Number Within A String

Feb 10, 2009

I would like to know how to detect a two digit number within a string.

For example: how can I pull the number 42 from that string?

## VS 2008 How To Store 40 Digit Number

Jul 28, 2011

Can i add, subtract, times, divide 40 digit number to 40 digit number ... example:

dim a as double = 1111111111111111111111111111111111111
dim b as double = 1111111111111111111111111111111111111
dim c as double

[code]....

## 6 Digit Number Generator By Clicking Button

Nov 11, 2010

I want to make a program that generates a 6 digit number for me by clicking a button. I can make a simple counter, but the nunmber I generate can only be used one. So , I need to store that number somehwere (access, xls, whatever) and then start the next count from the last number.

## Enter A Two-digit Number It Doesn't Wait?

Jan 27, 2012

I want to be able to enter (type in) data into a combobox as well as picking from the list. In earlier VB there was AfterUpdate event so that I could enter in the data I wanted. Now I have tried Keypress, Enter, and others and they all want just one character or number. If I try to enter a two-digit number it doesn't wait.

## Limiting A Textbox To Enter 10 Digit Number Only?

Oct 15, 2011

how can i limit a user to enter 10 digit no like telephone no in textbox without using regular expressions?

## Multiply A User Set Digit By A Text Box Number?

Mar 14, 2009

Ok, now I have another problem that I cant seem to figure out I now have the "Labour charge section" just incase the service requires one. which in alot of cases it does. So, I have a test box called text box 1, which I want to be able to insert "hours worked" which is a "digit" and then Have a fixed value, of five. Which the user can later change. The number from the box, and the user specified Hourly charge, must then be multiplied to create the total labour charge which will be inserted into a label view. So, my question first, is, how would the user be able to set the hourly charge and then not be able to change it by accident. I was thinking of having a tool strip with an options tab and then setting, and then you use that to fill the info, and have that hourly charge, hidden of the actuall form so that it cant be changed by mistake. Then, on to of that, how would you multiply these two numbers?

## Algorithm - Take A Database With Multiple Entries Of 11 Digit Number?

Jun 21, 2011

I am trying to take a database with multiple entries of 11 digit numbers and run a check sum algorithm that adds the 12th digit to the 11 digits as an output.The algorithm is as follows:

Add sum of odd digits starting with first digit, then multiply by 3.

Add sum of even digits, then add to result of odd digits multiplied by 3.

Take result and divide by 10. The remainder is the check sum which needs to be added to the end of the original 11 digits.

## Take Seven 2 Digit Numbers & Combine Them Into One Number To Store In A Database?

Jun 15, 2009

I'm looking for a way to take seven 2 digit numbers & combine them into one number to store in a database.The numbers represent hours for each day of the week & I only have one field to store them in. Then I need to be able to take the stored number & decode it back into the original seven numbers. Anyone have any clever ideas how I can do this?

## VAL Function Returning Negative Decimal Number For 8 Digit Hex Number?

Jun 23, 2009

I am calling the function below from an Excel spreadsheet and the conversion from hex to decimal using the VAL function in the "manufacturer" variable below is coming back with a negative value.  The VBA edition is 6.5.

Public Function decMEID(ByVal sKey As String) As String
Dim manufacturer As String
Dim serial As String

[code].....

## Asp.net - Generate And 7-digit Random Number/special Character String ?

Dec 1, 2010

How can I generate a 7-digit random number and special character string in a textbox on a button click event, in VB.Net?

## How To Validate Numeric / Alphanumeric / Currency And 4-digit Number In Textboxes

Apr 10, 2009

Can someone tell me how to validate numeric, alphanumeric, currency, and 4-digit number in textboxes ?

## Split A 2-digit Number From A Textbox And Store The Digits In Labels?

Nov 21, 2011

How do I split a 2-digit number from a textbox and put the first digit in one label and the second digit in another label when a button is clicked?

## Reversing A Number - Reverse A Digit (Graphics Mode)not Console Based

Aug 29, 2010

Is it possible.we can reverse a digit in VB.NET(Graphics mode)not console based

## Generate Serial Number (last Six Digit Number)

May 17, 2010

I want to generate a serial number in this format: INDDMMYY000001, INDDMMYY000002, INDDMMYY000003, ... I can generate INDDMMYY using following code: lblNoSiri.Text = "IN" + Date.Now.ToString("ddMMyy") However, I don't know how to generate the last six digit number. I only can generate number without zero in front of it. How to create the number with fix number of digit?

## Convert A Ten Digit Phone Number Without Dashes To One That Includes Dashes?

May 29, 2012

I am trying to convert a ten digit phone number without dashes to one that includes dashes.

4567891230 -->> 456-789-1230

the following code does absolutely nothing.

Code:
PTN = PTN.Insert(4, "-")
PTN = PTN.insert(8, "-")

## Add Record And Save In A File With A 4 To 6 Digit Number As File Name

Apr 26, 2009

I am currently working on a flatfile based database, meaning: all database records are saved in single files in a data folder of my main application. So far everything works fine except for one thing:

Each record gets currently saved as file under its item name. This sometimes causes problems because some item names contain special characters which can't be used as a file name. What I would like is the following: Whenever I 'add a record' to my database it should be saved in a file with a 4 to 6 digit number as file name - to keep things simple I just ignore the file extension for now.

For example, I add a new record with the ITEM NAME Flower "Blue River" #1 - I won't be able to create the file because of the special characters in there! I would like that the program creates automatically a file in a 4 or 6 digit format (I haven't decided yet how many digits because I am not sure how many data records I will need one day, so, 4 digits will be enougth for now!), starting at 1000, so, the file I am creating is called 1000 + whatever extension I will give it later.

In addition, I would like that it checks for missing numbers in between when creating a 'new database record', meaning: I have already the folloing file names: 1000, 1001, 1002 and one day I delete the second record, so, 1001 would be available for the next new file / data record which I add to my database.

So far I've experimented with the GUID but the filenames I get out of it are just not in an 'eye pleasing' format. Would there be a way to give this GUID a special format or is there any other good way to accomplish that?

## Datagridview Allow First Digit To Be Zero?

Jul 2, 2010

how can i set a data grid view control in visual basic .NET to allow the first digit in a numeric cell to be 0?

## Generate All Possible 3 Or 4 Digit Combinations?

May 30, 2009

I am trying to generate all possible 3 or 4 digit combinations from 0 to 9. I will be outputting them to a text file but I just need help with actually generating them.

## Get A 2 Digit Prefix That Increments?

Jul 18, 2009

i need a 2 digit prefix that increments. 1 - 99.. after reaching 99 it will be 100, that what im supposed to trap. if must be a0 - a9, after then b0-b9 ...... z0-z9.

## VS 2008 Datetimepicker Value Needs 2 Digit Day

Nov 11, 2009

How can I get the datetimepicker value to have a 2 digit day EX. If it was November 6, 2009 the value is showing as 11/6/2009 but I need it to be 11/06/2009

I have a search that searches by date and Im using the datetimepicker. the date format in from my sql database is in MM/DD/YYYY not MM/D/YYYY So my results come up ok if the day is a 2 digit day normally (ex. 11/20/2009)but if its a single date (11/6/2009) I don't get any results because it is looking for 11/06/2009 I don't see how I can get the value of datetimepicker to be MM/DD/YYYY Even if i set the custom format to MM/dd/yyyy the value is showing up as MM/d/yyyy

## VS 2010 - How To Get Two Digit Integer Always

Nov 7, 2010

I'm populating a checkedlistbox with this loop.
Dim week As Integer
For week = 1 To 51 Step 2
Next
And get this result 1 3 5 7 9 11 13 etc.
This is how I want it 01 03 05 07 09 11 13 etc.

## .net - Focusing Textbox In The Rightmost Digit?

May 14, 2009

how do i code this in vb.net: focus the textbox and get the cursor to the rightmost digit?

## Allow Only 2 Digit After Decimal Point In TextBox?

Sep 18, 2009

validation for , allow only 2 digit after decimal point in TextBox in vb.net eg 150.25