|
-
September 14th, 2001, 02:23 PM
#1
Changing hard code
I have an application that only accepts 7 digit ID numbers. I need it to accept 9 digits and 7 digits. The code is full of validation rules. I can get it to accept 9 by changing the 7s to 9s, but that doesn't help me. I need it to accept both. There are three areas in the code that I am hung up on.
qd!pSiteNumber = Left(cmbSite, 7)
Dim strSaveSiteNumber as String * 7
qd!PSaveSiteNumber = Left$(Trim(cmbSite.text),7)
Any suggestions would be GREATLY appreciated.
Pat
-
September 14th, 2001, 05:24 PM
#2
Re: Changing hard code
use a variable instead of a hard coded number.
Replace the 7 with something like intIDLen then define intIDLEN like DIM intIDLEN as Integer.
SOmeplace befopreprocessing, set intIDLEN to 7 or 9 depending on your needs at the time. The whole process looks something like this
Dim strSaveSiteNumber as string
Dim intIDLen as Integer
If somecondition then
intIDLen = 7
else
intIDLen = 9
End If
strSaveSiteNumber = mid$(strSaveSiteNumber, 1, intIDLen)
qd!pSiteNumber = Left(cmbSite, intIDLen)
qd!PSaveSiteNumber = Left$(Trim(cmbSite.Text), intIDLen)
John G
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|