Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RecordSource for Form/subform

Status
Not open for further replies.

richardii

Programmer
Jan 8, 2001
104
0
0
GB
When you create a form and subform using the wizard (using a query as the datasource). The final form shows the Recourdsource as the original table, rather than the query.

Why?
 
I'm answering my own questions, must be the first sign...

This was caused by the way I did it ("wrongly"). I created one query (from both tables - there's a one to many relationship) by using the *. I then selected this query in the form wizard. Access used the 'shortcut' back to the whole table, which isn't quite what I expected.

I should have made two queries from the tables, and then selected each, in turn, the wizard.

This may seem all a bit hypothetical but it has restricted how I can use the form (as it's now based on Tables not queries - which I can put conditions on etc.) So BEWARE!!
 
Actually, internally Access uses the equivalent of a query as the RecordSource even if you select a table as the source basis for the form. You can always change the recordsource to an editable query after creation of the form by clicking the button to the right of the RecordSource property. If the form isn't based on a query Access will create one for you. You then have absolute control over how the query behaves, sort order, creation of calculated controls, etc. You may also add additional tables to give you access to data on your form for display purposes while still maintaining the ability to add/edit data for the underlying bound recordset. If you use this latter technique take care that you don't inadvertantly allow data in other tables to be changed that you may not want changed.
 
if you link the recordsource to a MSDE table, how do you get it to be editable...i keep getting recordset is not updateable.
 
hinchdog,

If your form is based on a query that joins several tables, you'll have to set the Unique Table property for your form to whatever you've called your Many-Side table.

Hope this helps.

Keng
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top