Non-VBA expert: how to reference controls

mikeg8

New member
Local time
Today, 03:48
Joined
Sep 22, 2006
Messages
2
:confused: Apologies if this post is in the wrong place, but here goes:

Background: I'm a non-VBA expert so assume I know nothing (I know I know nothing!)

Can someone explain and give examples of how you refer to controls on a form in VBA code? Both bound and unbound. What.do.all.these.dots mean? [Why]![are]![things] written like this, sometimes? I know who I am, so who is me.something or other?

A long time ago I used to program in Basic, also Pascal and even Cobol. I'm sure it was easier then!:o
 
Here's a good list of referencing controls.

Basically dots applies to properties that usually comes with a given control/forms whereas bang (!) applies to properties that you created yourself (e.g. fields). Bang operator is usually necessary only when you're not referring to controls in the active form.

[] is delimiter so you could have a field name with spaces. However this isn't recommended at all.

Also, you can use expression builder to help find the correct path to various controls that may not be on the same form. Use a query as a recordsource, and in the criteria row, right click and select "Build...", or for calculated controls, click the "..." button next to its controlsource property.

HTH.
 

Users who are viewing this thread

Back
Top Bottom