Deciding which table to write to

  • Thread starter Thread starter recoverybob
  • Start date Start date
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.
 
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
 
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.
 
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!
 
Back
Top