Kenny Henderyck
Nieuwe gebruiker
- Lid geworden
- 8 nov 2007
- Berichten
- 3
Hi all,
ik heb twee tabellen:
1) tabel die data bevat uit een systeem
2) tabel die inconsistencies beschrijft
de inconsistencies die in tabel 2 worden beschreven zou ik willen testen op de data van tabel 1.
tabel 1 bevat volgende kolommen:
Item, lokatie, actief/inactief, safety stock, ......
tabel 2 bevat volgende kolommen
actief/inactief, safetystock, ......
elke rij in tabel 2 (vb actief + safetstock <>0 = inconsitency 1) vormt een inconsistency
ik zou hiervoor een custom function willen schrijven in VBA. Nu ik ben nieuw in VBA dus dit vlot niet zo makkelijk.
Ik werk met SELECT CASE waarbij elke inconsistency een andere case is en waarin ik met een iif statement de inconsistency beschrijf.
Maar ik heb geen idee hoe ik de twee tabellen waarvan ik bepaalde velden met elkaar vergelijk in mijn function inlaad.
hieronder heb ik mijn eerste 'poging' erbij gezet
Public Function Check_Inconsistency(Inconsistency As String) As String
Dim Inconsistency
a= Basic data (non-case specific I) //tabel 1
b= non-case specific inconsistencies //tabel 2
Select Case Inconsistency
Case "Active SKU without ABC-classification"
iif(
a![External SKUSw] = b![External SKUSw]
AND
a![UDC_INVEN_ABC_CD] = b![UDC_INVEN_ABC_CD]
And
(a![MFG_POLICY 1] <> b![MFG_POLICY]
OR
a!a![MFG_POLICY 2] <> b![MFG_POLICY])
, "YESactiveskuwithoutabc-classification", "empty")
Case "Inactive SKU with ABC-classification"
iif(
a![External SKUSw] = b![External SKUSw]
AND
a![UDC_INVEN_ABC_CD] = b![UDC_INVEN_ABC_CD]
, "YESinactiveskuwithabc-classification", "empty")
Case Else
Debug.Print "other inconsistency"
End Select
End Function
ik heb twee tabellen:
1) tabel die data bevat uit een systeem
2) tabel die inconsistencies beschrijft
de inconsistencies die in tabel 2 worden beschreven zou ik willen testen op de data van tabel 1.
tabel 1 bevat volgende kolommen:
Item, lokatie, actief/inactief, safety stock, ......
tabel 2 bevat volgende kolommen
actief/inactief, safetystock, ......
elke rij in tabel 2 (vb actief + safetstock <>0 = inconsitency 1) vormt een inconsistency
ik zou hiervoor een custom function willen schrijven in VBA. Nu ik ben nieuw in VBA dus dit vlot niet zo makkelijk.
Ik werk met SELECT CASE waarbij elke inconsistency een andere case is en waarin ik met een iif statement de inconsistency beschrijf.
Maar ik heb geen idee hoe ik de twee tabellen waarvan ik bepaalde velden met elkaar vergelijk in mijn function inlaad.
hieronder heb ik mijn eerste 'poging' erbij gezet
Public Function Check_Inconsistency(Inconsistency As String) As String
Dim Inconsistency
a= Basic data (non-case specific I) //tabel 1
b= non-case specific inconsistencies //tabel 2
Select Case Inconsistency
Case "Active SKU without ABC-classification"
iif(
a![External SKUSw] = b![External SKUSw]
AND
a![UDC_INVEN_ABC_CD] = b![UDC_INVEN_ABC_CD]
And
(a![MFG_POLICY 1] <> b![MFG_POLICY]
OR
a!a![MFG_POLICY 2] <> b![MFG_POLICY])
, "YESactiveskuwithoutabc-classification", "empty")
Case "Inactive SKU with ABC-classification"
iif(
a![External SKUSw] = b![External SKUSw]
AND
a![UDC_INVEN_ABC_CD] = b![UDC_INVEN_ABC_CD]
, "YESinactiveskuwithabc-classification", "empty")
Case Else
Debug.Print "other inconsistency"
End Select
End Function