Referring a form's fields in VBA

DNewman

Registered User.
Local time
Today, 01:36
Joined
Oct 12, 2012
Messages
60
Something I have always wanted to know!
Why is it that you can refer, in a vba sub, to a field (that you don't want to see on your form) perfectly happily ... and then one day (maybe you have moved the Db to a different PC)... ***CRASH***, and you have to create a hidden textbox for that field (which maybe you should have done in the first place!)?
 
Sorry I am new to this game although old to access - this has happenned so many times to me from Access 2, 97, 2000, 2010(?) in windows 98, 2000, XP, 7! I thought maybe it happened to everyone! Is it just bad practice on my part to refer to fields which don't have a control on the form?
 
I would usually use: Me.TheField where TheField is in the RecordSource but not explicitly on the form
 
Many thanks, all I have to do now is unlearn 20 years of bad practice.
How do I close this thread, or is that your job?
 

Users who are viewing this thread

Back
Top Bottom