Saving a Related Key or the Actual Value in MVF.
My previous discussion on using a look up table was not complete.
This obfuscation is one of the things that drives people absolutly crazy about MVFs
1. From a lookup table you will save either the PK of the lookup as the value in the hidden table or you will save the actual value. You may find when using the wizard that it creates a relationship using the key when you think you are saving an actual value. As far as I can tell this is automatic and depends on how you do the wizard and if the lookup table has a PK. And depends on how many columns you show in the pull down. Lets assume the lookup table has a PK In this case tblRegions with a StateID pk.
Most of the time a users wants to save a key, but there are times the users want to save just the value (or at least thinks that is what they are doing.)
If using the wizard and choose just the State value (not the ID), the user may assume they are storing the actual state value in the MVF. They only choose one field and did not include the StateID
However, the wizard automatically pulls in the StateID into the rowsource and binds the StateID to the hidden table. The user may think they are storing "Arizona", but are storing the ID 4.
The next screen in the wizard is
Unless the user chooses to show both columns in the pull down the user does not get an option to choose which field to bind.
But you can trick the wizard, if you simply want to store a value. You can do this by first making a query of tblRegion and return only the State name. Then If I use the lookup wizard on my query I can select state and it will store the actual state name and not a key in the value.
Now your better option is to use the properties where you can more clearly set the rowsource, column count, column widths, and bound column. But novice users may not be good with those properties.
2. You can see this here were I have 2 regions field. One is an MVF with a key stored in the hidden table and one with the actual State name stored.
Notice one field says number the other says short text.
3. What is so utterly confusing and will get both seasoned and novice users is that this is completely obfuscated. They appear identical except one value property show text but is actually storing a number, the other is showing text and actually storing text.
It is worse when including the value field
Both value fields show a name, but the first does not hold a name but a value.
To prove this here are the two queries that will return the same records.