Loop over highlighted tables?

jplank

New member
Local time
Today, 05:25
Joined
Mar 27, 2013
Messages
4
I'm familiar with Excel vba, but I'm pretty new to using vba in Access. I have a macro set up to loop over all tables:

Code:
For Each tbl In CurrentDb.TableDefs

**stuff**

Next
I'd like to modify it so that the **stuff** only gets applied to tables that are actually highlighted before the macro is run. Is there an easy way to do this?
 
What do you mean by "highlighted"? Selected in the navigation pane? I'm not sure if there's a way to programmatically tell if a table is selected in the navigation pane, but I wouldn't recommend it anyway because it would require that your users have access to the design side of the application.

If you want to do this, I suggest you load the table names into a multi-select list box on a form and use the ItemsSelected property to determine which tables you want to do "stuff" with.
 
What do you mean by "highlighted"? Selected in the navigation pane? I'm not sure if there's a way to programmatically tell if a table is selected in the navigation pane, but I wouldn't recommend it anyway because it would require that your users have access to the design side of the application.

Yeah, I meant selected in the navigation pane. There's only myself and one other coworker who has access to the file, so I don't think it should be too much of a problem.

If you want to do this, I suggest you load the table names into a multi-select list box on a form and use the ItemsSelected property to determine which tables you want to do "stuff" with.

Thanks for the tip. I'll definitely look into this.
 

Users who are viewing this thread

Back
Top Bottom