Joining Form with Subform

G

gatarossi

Dear all,

In my table, I have these fields:

expense_code
profit_center
date
value

I must put in my form these fields: profit_center and date.

I must put in my subform (type: leafs of data) these fields:
expense_code and value.

As I'm a beginner user of access, I only use the assistent to create
my forms and I have a problem ==> by assitent I only filter my subform
by the profit_center. I must filter my subform by assistent and the
date. Obs. With this united I input datas in the table, it´s not for
consult!

For example:

Datas in the table

expense_code profit_center date value
salary industrial 01/01/07 1000
salary industrial 01/02/07 1500
salary administrative 01/01/07 500

What is showing in my form/subform

Form:
profit_center (combobox): then I select Industrial
date (listbox): then I select 01/01/07 (but it's doesn't work)

Subform:
expense_code value
salary 1000
salary 1500

How can I do to filter my subform for both fields: profit_center and
date? My form and subform are linked with my "exepnses" table.

Thank´s

André.
 
J

Jeff Boyce

André

A main form/subform construction is used to display data that is in a
one-to-many relationship (i.e., two tables). From your description, you are
only using one table.

If one [profit_center] and [date] can have many [expense_code]s and
[value]s, then you need to use two tables.

By the way, the word "date" (and perhaps "value") are reserved word in
Access. What Access means by them and what you want them to mean may not
always match. Consider renaming these fields.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/



Dear all,

In my table, I have these fields:

expense_code
profit_center
date
value

I must put in my form these fields: profit_center and date.

I must put in my subform (type: leafs of data) these fields:
expense_code and value.

As I'm a beginner user of access, I only use the assistent to create
my forms and I have a problem ==> by assitent I only filter my subform
by the profit_center. I must filter my subform by assistent and the
date. Obs. With this united I input datas in the table, it´s not for
consult!

For example:

Datas in the table

expense_code profit_center date value
salary industrial 01/01/07 1000
salary industrial 01/02/07 1500
salary administrative 01/01/07 500

What is showing in my form/subform

Form:
profit_center (combobox): then I select Industrial
date (listbox): then I select 01/01/07 (but it's doesn't work)

Subform:
expense_code value
salary 1000
salary 1500

How can I do to filter my subform for both fields: profit_center and
date? My form and subform are linked with my "exepnses" table.

Thank´s

André.
 
G

gatarossi

Dear Jeff,

Ok, now I create more three tables:

1) expenses_plan
fields: - expenses_code
- expenses_description

2) profit_center
fields: - profit_center_code
- profit center_description

3) period
field: - period_code

And I made relationships with the table expenses_control
4) expense_control
fields: expense_code = expense_code.expense_plan
profit_center_code = profit_center_code.profit_center
period_code = period_code.period
numbers

I have already tryed everything, but I really don't known how to
create this form/subform:


Form:
profit_center (combobox): then I select Industrial
date (listbox): then I select 01/01/07 (but it's doesn't work)


Subform:
expense_code value
salary 1000
salary 1500
..
..
..

This form/subform is used to imput, to exclude and to change datas,
not only for consult. Can you help with this big problem?

Thanks a lot!!!

André.
 

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

Similar Threads

Building Form 4
Dynamic Forms 2
Building Form 3
Exclude Data of Access 3
Exclude Data 2
Calculated fields in a subform 1
Multiselect Listbox 1
Dobts in Create a Form 3

Top