Check boxes to appear with Table Names

hewstone999

Registered User.
Local time
Today, 10:12
Joined
Feb 27, 2008
Messages
37
What I want is check boxes to appear on a form with the name of the tables.

i.e. I Currently have 3 tables (there are more tables in my database but for this example I will only use 3) - MPI_CORE, MPI_IDS and REFF_DR.

I want some code to put the table names as a check box i.e.

[] MPI_CORE
[] MPI_IDS
[] REFF_DR

*please note [] = a check box

How could I do this using VBA?

Thanks in advance for your help :)
 
Check out the Currentdb.tabledefs object... that should help you.
 
Simple Software Solutions

If the names of the tables are static and not subject to change, why do you need VBA to display the table names? why not simply type them in to the label attached to each check box:confused:

Also you could give the caption a more meaningful name and use VBA to select the correct table name based on the OnClick Event of the checkbox.

Also if the user can only pick one at a time then I suggest you create an Options Group instead of three individual checkboxes as it will enable the user to tick more than one table name at a time.

CodeMaster::cool:
 
if you are trying to change the caption of a label linked to a chkbox programatically then you need to know what the label is called, because you cant find the name of a label linked to a control directly from the control itself

therefore it helps to have a naming convention for your controls and labels if you are trynig to find the label associated with any given control

ie if you have a chkbox called chk1, you cant determine the name of its label, but if your convention determines that its called labelchk1 say, then you can reference it directly as:

controls("labelchk1").caption

interestingly, you can go the other way, and get the name of the linked control directly from the label
 

Users who are viewing this thread

Back
Top Bottom