Deciding which table to write to

R

recoverybob

I have several tables I want to use the same form for, I would like to
select the record source from a combo box.
I have a combo box that list all the tables from a table named "Table
names" when I select the name I would like that to be the record
source for my subform. So I can input new records.
 
R

recoverybob

I have several tables I want to use the same form for, I would like to
select the record source from a combo box.
I have a combo box that list all the tables from a table named "Table
names" when I select the name I would like that to be the record
source for my subform. So I can input new records.

test
 
M

Marshall Barton

I have several tables I want to use the same form for, I would like to
select the record source from a combo box.
I have a combo box that list all the tables from a table named "Table
names" when I select the name I would like that to be the record
source for my subform. So I can input new records.


This kind of problem is a red flag that your table design is
seriously flawed. Tables like that might be how things
could be done in a spreadsheet instead of a database.

If you persist with your tables the way they are, you can do
what you ask to work around the current problem by using the
combo box's AfterUpdate event to set the form's RecordSource
property to the selected table name:
Me.RecordSource = Me.thecombobox

Please be aware that that is not a solution. It just allows
you to dig the hole deeper so it will be more difficult to
get out of when you run into more and more complex problems
in the future.
 
R

recoverybob

This kind of problem is a red flag that your table design is
seriously flawed.  Tables like that might be how things
could be done in a spreadsheet instead of a database.

If you persist with your tables the way they are, you can do
what you ask to work around the current problem by using the
combo box's AfterUpdate event to set the form's RecordSource
property to the selected table name:
        Me.RecordSource = Me.thecombobox

Please be aware that that is not a solution.  It just allows
you to dig the hole deeper so it will be more difficult to
get out of when you run into more and more complex problems
in the future.

Thanx alot that will work fine!
 

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