SubForm

A

Abdul Shakeel

Hi All,

I have a form frmPayroll which is made-up via a query combination of 3 more
tables in the database, I just want know could I use some fields from this
query as a subform in same form.
 
J

John W. Vinson/MVP

Hi All,

I have a form frmPayroll which is made-up via a query combination of 3 more
tables in the database, I just want know could I use some fields from this
query as a subform in same form.

Well... you could... but that's not how best to use subforms.

Rather than creating one complex multitable query and trying to base a
Form on it, consider instead using the Form and Subform to manage data
for a "parent" table and a "child" table.

Typically you will use a Form based on the "one" side table of a
relationship, with a Subform for the "many" side table. The Master
Link Field property of the subform is the name of the master table's
primary key field; the Child Link Field is the name of the related
foreign key. This keeps the two tables in synch.

Basing your form on a three table query will cause all sorts of
complications; not least is that you will see the main table data
repeated as many times as there are child records.
 
A

Abdul Shakeel

Thanks for your reply...is there any otherway to do this??? Could I use
DataGrid Control??
 
J

John W. Vinson/MVP

Thanks for your reply...is there any otherway to do this??? Could I use
DataGrid Control??

Possibly.

Could you explain what "this" is that you are trying to accomplish?
Can it not be done using subforms? If not why not?
 
A

Abdul Shakeel

Hi,

Here this means I want to use some of my query fields in my form as sub form
if I could not use these fields as a subform due to some complexities, would
I use another method, such as Data Grid control etc.
 
J

John W. Vinson/MVP

Hi,

Here this means I want to use some of my query fields in my form as sub form
if I could not use these fields as a subform due to some complexities, would
I use another method, such as Data Grid control etc.

But you CAN use some fields in the subform. I've not seen any
"complexities".

If you're having a problem doing so, please explain the problem -
indicate the recordsource of the form (post the SQL), what fields you
want to see on the subform, why you're apparently rejecting my
suggestion of using the form for the main table and the subform for
the child table.

YOU can see your database. You know what you want to do. We can only
see what you post here. Please reread your posts, with the attitude
that they comprise everything that you know about the database - do
they convey enough information for someone to help? I'm afraid they
don't.
 
Top