B
bradjensmith
I have an easy vb question in MS Access. I'm looking to modify an
account number field that may contain hyphens. Forgive my "ugly"
code...
Currently I read in the field from the table and write it directly back
out.
Here's the SQL that pulls the data (including the Account_num field):
DIR_DEP_DISTRIB_tbl = "SELECT [DIRDEPDIST].*,DATASRCE_ID.US_CAN_IND " +
_
"FROM DIRDEPDIST INNER JOIN DATASRCE_ID ON
DIRDEPDIST.EMPLID = DATASRCE_ID.EMPLID " + _
"WHERE (((DATASRCE_ID.US_CAN_IND)='USA')); "
and then later I'm currently outputting like this to a text file:
Print #1, Tab(1); _
in_recs.Fields("EMPLID").Value & "|" & _
IIf(IsNull(in_recs.Fields("EFFDT").Value), "01JAN1900",
Format(CDate(in_recs.Fields("EFFDT").Value), "ddmmmyyyy")) & "|" & _
in_recs.Fields("PRIORITY").Value & "|" & _
in_recs.Fields("ACCOUNT_NUM").Value & "|" & _
in_recs.Fields("ACCOUNT_TYPE").Value & "|" & _
in_recs.Fields("BANK_CD").Value & "|" & _
in_recs.Fields("DEPOSIT_AMT").Value & "|" & _
in_recs.Fields("AMOUNT_PCT").Value & "|" & _
IIf(in_recs.Fields("DEPOSIT_TYPE").Value = "B", "Y", " ") & "|" & _
Format(Date, "ddmmmyyyy") & "|INITLOAD|" & _
Format(Date, "ddmmmyyyy") & "|INITLOAD";
The ACCOUNT_NUM field is the field I need to modify to suppress hyphens
if they appear.
Thanks for any help!!
account number field that may contain hyphens. Forgive my "ugly"
code...
Currently I read in the field from the table and write it directly back
out.
Here's the SQL that pulls the data (including the Account_num field):
DIR_DEP_DISTRIB_tbl = "SELECT [DIRDEPDIST].*,DATASRCE_ID.US_CAN_IND " +
_
"FROM DIRDEPDIST INNER JOIN DATASRCE_ID ON
DIRDEPDIST.EMPLID = DATASRCE_ID.EMPLID " + _
"WHERE (((DATASRCE_ID.US_CAN_IND)='USA')); "
and then later I'm currently outputting like this to a text file:
Print #1, Tab(1); _
in_recs.Fields("EMPLID").Value & "|" & _
IIf(IsNull(in_recs.Fields("EFFDT").Value), "01JAN1900",
Format(CDate(in_recs.Fields("EFFDT").Value), "ddmmmyyyy")) & "|" & _
in_recs.Fields("PRIORITY").Value & "|" & _
in_recs.Fields("ACCOUNT_NUM").Value & "|" & _
in_recs.Fields("ACCOUNT_TYPE").Value & "|" & _
in_recs.Fields("BANK_CD").Value & "|" & _
in_recs.Fields("DEPOSIT_AMT").Value & "|" & _
in_recs.Fields("AMOUNT_PCT").Value & "|" & _
IIf(in_recs.Fields("DEPOSIT_TYPE").Value = "B", "Y", " ") & "|" & _
Format(Date, "ddmmmyyyy") & "|INITLOAD|" & _
Format(Date, "ddmmmyyyy") & "|INITLOAD";
The ACCOUNT_NUM field is the field I need to modify to suppress hyphens
if they appear.
Thanks for any help!!