More than 1 record source needed.

B

Bunky

I have a form that is driven by a query that writes to a table. I want some
data on the form to go to one table and some to others. What is the best way
to accomplish this?

Thank you for your assistance.
 
J

Jerry Whittle

You could change the record source for the form with code. The code in the On
Click event of a button on the form would look something like:

Me.RecordSource = "SELECT Orders.* FROM Orders; "

However I question if your tables are set up properly. The same kind of data
should almost always be in the same table. If you have something like a table
for one year and another for the previous year, this is a mistake. Same thing
goes if you have a table for each division of a company.
 
B

Bunky

Jerry,

My application is this.

I have a Monitor form that has information for the employee, the question
number and the score that the employee was given by the supervisor filling
out the form. I have a Staff table for the employee data, a Question Table
for the type and number of questions that should be on the form, and lastly
the score the supervisor assigned. I was trying to do this with a Query but
it would not let me add data because I had some joins in the Query. Do I
need to put the VB code on each different control?

Thanks,
 
J

Jerry Whittle

Aha! That's a whole 'nother problem.

First open up the Relationship Window and link tables together. For this to
work right, you must have a primary key assigned to each table and a foriegn
key in the matching table. Try to enable Referential Integrity on these
joins. If it won't work, you probably have some dirty data. For example an
employee without a valid boss.

After that is done, create a form based on the main table. For example if
the Staff is the main focus, create the form on it. Next create subforms
based on the other tables. If you have the relationships defined, Access will
link the form and subforms together for you.

That should fix the problem.
 
Top