Need Code for Validation

MeisterGirl

Registered User.
Local time
Today, 17:05
Joined
Aug 8, 2001
Messages
11
I have a field that needs to sync up with another field. For the sake of discussion we'll call them "Code" field and "Type" field. What is the code I would need to make it do something like this:
If 'Code' = EA Then 'Type' = HMD or If 'Code' = IN Then 'Type' = WAT.

I have 5 different 'Code' types that need to set the 'Type' field. What would the code be and would it need to be in the 'On Update', 'After Update' etc.

Thanks!
 
hi Meister,

my advice is please don't do it in code - i've inherited a db set up by someone that hard coded all these type of mappings and it's a total nightmare. Either you or the person that follows will curse the day you wrote it! The best way to go is to make a mapping table - eg you have a table of "Codes" and one of "Types" and one that puts the 2 together in every different combination that you need. That way when IN suddenly starts mapping to HMD ( probably due to a random management decision ) you have a 2 second job to change the data. Or even better you can say 'i only build dbs - the data belongs to you guys, now leave me alone'. The other way has you trekking thru lines of code that get cruftier and more obfuscated as time goes on. Sorry about the lack of code but i feel quite strongly about it
smile.gif


HTH,

Drew

Oops, just looked at your job title - i don't hate all managers, just the ones that make my life more difficult. oh, hold on - that is all managers... lol

[This message has been edited by KDg (edited 08-13-2001).]
 

Users who are viewing this thread

Back
Top Bottom