Hi
I am trying to elimiate the multiple fields. REDUCE FROM MANY TO ONE! What I got:
AMEXXUSD1
AMEXXUSD1 - remove
AMEXXUSD2
AMEXXUSD2 - remove
AMEXXUSD4
AMEXXUSD4 - remove
AMEXXUSD5
AMEXXUSD5 - remove
AMEXXUSD7
AMEXXUSD7 - remove
AUSXXAUD1
AUSXXUSD1
AUSXXAUD2
AUSXXUSD2
AUSXXAUD4
AUSXXUSD4
AUSXXAUD5
AUSXXUSD5
AUSXXAUD7
AUSXXUSD7
FRAXXFRF1
I wrote the code via Modules. Here it is:
'WORLD - AMEUKEXXXXXP
Set rsStruc = dbStruc.OpenRecordset("AMEUKEXXPPP", dbOpenSnapshot)
rsStruc.MoveFirst
Do Until rsStruc.EOF
strBU = Right(rsStruc.Fields("BUSINESS_UNIT", 3)
strBUDesc = rsStruc.Fields("Bu ShortDesc"
strCCC = rsStruc.Fields("CURCODE"
strP = rsStruc.Fields("PRACTICE"
strPDesc = rsStruc.Fields("DESCRIPTION"
'NAME - WORLD
strEnt = strBU & "XX" & strCCC & strP
strEnt2 = strBU & "XXUSD" & strP
strEntDesc = strBUDesc & " " & strPDesc
If strEnt1 <> strEnt And strP <> 0 Then Print #intName, strEnt & "!" & strEntDesc & "!" & strBU & strP & strNameEnd & strCCC & strNameEnd1
If strEnt1 <> strEnt And strP = 0 Then Print #intName, strEnt & "!" & strEntDesc & "!" & strBU & strP & strNameEnd & strCCC & strNameEnd1
If strEnt3 <> strEnt2 And strP <> 0 Then Print #intName, strEnt2 & "!" & strEntDesc & "!" & strBU & strP & " ! !USD !0! ! ! ! !CHART! ! ! !CHART"
If strEnt3 <> strEnt2 And strP = 0 Then Print #intName, strEnt2 & "!" & strEntDesc & "!" & strBU & strP & " ! !USD !0! ! ! ! !CHART! ! ! !CHART"
'OWNER - WORLD
If strEnt1 <> strEnt And strP <> 0 Then Print #intOwn, strBU & strLOC & "!" & strEnt & strOwnEnd
If strEnt <> strEnt2 And strP <> 0 Then Print #intOwn, strBU & strLOC & "!" & strEnt2 & strOwnEnd
strEnt1 = strEnt
strEnt3 = strEnt2
rsStruc.MoveNext
Loop
rsStruc.Close
Please advise. I kindly appreciate your help.
Regards,
CHsu [sig][/sig]
I am trying to elimiate the multiple fields. REDUCE FROM MANY TO ONE! What I got:
AMEXXUSD1
AMEXXUSD1 - remove
AMEXXUSD2
AMEXXUSD2 - remove
AMEXXUSD4
AMEXXUSD4 - remove
AMEXXUSD5
AMEXXUSD5 - remove
AMEXXUSD7
AMEXXUSD7 - remove
AUSXXAUD1
AUSXXUSD1
AUSXXAUD2
AUSXXUSD2
AUSXXAUD4
AUSXXUSD4
AUSXXAUD5
AUSXXUSD5
AUSXXAUD7
AUSXXUSD7
FRAXXFRF1
I wrote the code via Modules. Here it is:
'WORLD - AMEUKEXXXXXP
Set rsStruc = dbStruc.OpenRecordset("AMEUKEXXPPP", dbOpenSnapshot)
rsStruc.MoveFirst
Do Until rsStruc.EOF
strBU = Right(rsStruc.Fields("BUSINESS_UNIT", 3)
strBUDesc = rsStruc.Fields("Bu ShortDesc"
strCCC = rsStruc.Fields("CURCODE"
strP = rsStruc.Fields("PRACTICE"
strPDesc = rsStruc.Fields("DESCRIPTION"
'NAME - WORLD
strEnt = strBU & "XX" & strCCC & strP
strEnt2 = strBU & "XXUSD" & strP
strEntDesc = strBUDesc & " " & strPDesc
If strEnt1 <> strEnt And strP <> 0 Then Print #intName, strEnt & "!" & strEntDesc & "!" & strBU & strP & strNameEnd & strCCC & strNameEnd1
If strEnt1 <> strEnt And strP = 0 Then Print #intName, strEnt & "!" & strEntDesc & "!" & strBU & strP & strNameEnd & strCCC & strNameEnd1
If strEnt3 <> strEnt2 And strP <> 0 Then Print #intName, strEnt2 & "!" & strEntDesc & "!" & strBU & strP & " ! !USD !0! ! ! ! !CHART! ! ! !CHART"
If strEnt3 <> strEnt2 And strP = 0 Then Print #intName, strEnt2 & "!" & strEntDesc & "!" & strBU & strP & " ! !USD !0! ! ! ! !CHART! ! ! !CHART"
'OWNER - WORLD
If strEnt1 <> strEnt And strP <> 0 Then Print #intOwn, strBU & strLOC & "!" & strEnt & strOwnEnd
If strEnt <> strEnt2 And strP <> 0 Then Print #intOwn, strBU & strLOC & "!" & strEnt2 & strOwnEnd
strEnt1 = strEnt
strEnt3 = strEnt2
rsStruc.MoveNext
Loop
rsStruc.Close
Please advise. I kindly appreciate your help.
Regards,
CHsu [sig][/sig]