Value

Use "Value" or Not?

I’ve noticed a couple of minor glitches caused by the default of a ‘textbox’, the value; not being assigned explicitly. It’s not a big problem and I don’t think it will affect many people, possibly nobody! However I think there’s a good blog in it for someone, possibly me, when I’ve got the time, or someone else might pick it up and carry it…

Not done any research on this. I’m just recording instances where I notice a problem. Hopefully I, or someone else will have time to investigate more thoroughly. The first time I noticed the problem was when converting a macro into VBA code.  See my Blog about it HERE:-

TempVars Value Error

I think it was the macro from the sample Northwind database, and in particular it was in the login form. If my recollection is correct, the conversion assigned a textbox value to a TempVar. The problem I noticed was that it tried to assign the textbox as control, therefore it did not automatically extract the value from the textbox it tried to assign the textbox as a control which caused an error.

I considered this a minor glitch and would very seldom cause anyone a problem and put it to the back of my mind.

If you’re not familiar with the Northwind Sample Database, then I’ve done a quick video demonstrating how to install and use it here:-    Setup the Northwind dB 

However whilst researching

“DoCmd.RunCommand acCmdSaveAsOutlookContact”

which I also found in the Sample Northwind Database.

I took a particular interest in it because it was a command I hadn’t come across before.

Whilst researching it, I ran across this thread:-   Save as Outlook Contact Problem 

Which harkens back to a similar error with the value of a textbox. Hence I’m putting two and two together and possibly making Five> I note some similarity between my two observations and thought it’s worth recording…

My thinking is if there is any possibility of your textbox value being assigned to a control variable, then you must use value explicitly. In some ways this sentence doesn’t make much sense! I think it’s just my paranoia…. possibly… who said that?

…         ..         ..            ..        ..          ..           ..     ..  ..         … 

… …

Leave a Comment