G
Guest
I need to separate a single string into 5 Different Fields...
If someone helps me by giving me code for this, can they also help me, with
having the code apply itself to the whole recordset... cause for example, I
know how to use the Left function and what not to extract a single record, by
making a form with textboxes, and putting the following into the OnCurrent
event, this method, however, I have to scroll down 250,000 records... very
time consuming...
-------------------------------------------------------------------------------------
Dim strCode, strName, strSex, strDate, strDateFixed, strMo, strDa, strYe As
String
Dim intCounty, intID As Integer
Dim dDate As Date
'separates everything
strName = Left(strCode, 6)
strDate = Mid(strCode, 7, 6)
intCounty = Mid(strCode, 13, 2)
strSex = Mid(strCode, 15, 1)
intID = Right(strCode, 3)
'fix date format since it was in yy/mm/dd
strYe = Left(strDate, 2)
strMo = Mid(strDate, 3, 2)
strDa = Right(strDate, 2)
strDateFixed = strMo & "/" & strDa & "/" & strYe
dDate = strDateFixed
'sets it back to the control on the form
Me.CVE_NOM = strNombre
Me.CVE_DOB = dFecha
Me.CVE_EDO = intEdo
Me.CVE_GEN = strSexo
Me.CVE_ID = intID
Me.Repain
If someone helps me by giving me code for this, can they also help me, with
having the code apply itself to the whole recordset... cause for example, I
know how to use the Left function and what not to extract a single record, by
making a form with textboxes, and putting the following into the OnCurrent
event, this method, however, I have to scroll down 250,000 records... very
time consuming...
-------------------------------------------------------------------------------------
Dim strCode, strName, strSex, strDate, strDateFixed, strMo, strDa, strYe As
String
Dim intCounty, intID As Integer
Dim dDate As Date
'separates everything
strName = Left(strCode, 6)
strDate = Mid(strCode, 7, 6)
intCounty = Mid(strCode, 13, 2)
strSex = Mid(strCode, 15, 1)
intID = Right(strCode, 3)
'fix date format since it was in yy/mm/dd
strYe = Left(strDate, 2)
strMo = Mid(strDate, 3, 2)
strDa = Right(strDate, 2)
strDateFixed = strMo & "/" & strDa & "/" & strYe
dDate = strDateFixed
'sets it back to the control on the form
Me.CVE_NOM = strNombre
Me.CVE_DOB = dFecha
Me.CVE_EDO = intEdo
Me.CVE_GEN = strSexo
Me.CVE_ID = intID
Me.Repain