Open Table based on combobox selection

I

irbtastic

Hello,

I have an unbound form on which I would like to create a combobox that has a
list of certain tables in my db (2 columns, first column is the table name
alias and the 2nd column is the actual table name).

I would like the user to select one table name alias from the list of tables
in the combo box and click an 'OK' button that will trigger an event
procedure to open the specific table that the user selected.

Is this possible? Does anyone know how to do this?

Thank you in advance!
Emily
 
D

Daniel Pineault

You should never give users access to the tables! They should always use
forms. Why do you wish to do this?

Now to answer you question, even though i would highly suggest you rethink
this. try something like:

DoCmd.OpenTable forms![FormName].Form.ComboBoxName.Column(1), acViewNormal

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
I

irbtastic

Thank you! This works perfectly.

Daniel Pineault said:
You should never give users access to the tables! They should always use
forms. Why do you wish to do this?

Now to answer you question, even though i would highly suggest you rethink
this. try something like:

DoCmd.OpenTable forms![FormName].Form.ComboBoxName.Column(1), acViewNormal

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



irbtastic said:
Hello,

I have an unbound form on which I would like to create a combobox that has a
list of certain tables in my db (2 columns, first column is the table name
alias and the 2nd column is the actual table name).

I would like the user to select one table name alias from the list of tables
in the combo box and click an 'OK' button that will trigger an event
procedure to open the specific table that the user selected.

Is this possible? Does anyone know how to do this?

Thank you in advance!
Emily
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top