simonpickering
New member
- Local time
- Today, 13:53
- Joined
- Oct 29, 2012
- Messages
- 3
Hi,
I'm new to the forum, struggling and would really appreciate some help with an Access Form problem.
I'm building a database that will track payments made to individuals.
Each single payment consists of multiple elements that, when added together, result in one cheque made payable to the person. These Payment Elements are currently 'Hotel Room', 'Travel', 'Food' and 'Honorarium'.
I'd like to track all the elements so that I can add up, say, all the Food costs for a period.
I've made tables similar to these:
So now I'm stuck.
I'd like a sub-form that contains rows of Payments - one row for each payment. There would be text boxes for Date and then the four current Payment Element types and possibly some code that adds the payments to display the total.
I can't work out how to filter each Payment Element text box on the sub form so that the first one only shows the record for Payment Element Type 1 (Hotel), the second for Payment Element Type 2 (Travel), the third for Type 3 (Food) etc.
It's as if I need four different sub-forms within my sub-form - but that seems complicated! I must be able to filter for the PaymentElement ID - within the text box perhaps?
Am I on the right lines? My only other way I can think of is to create separate tables for each payment type - but I think that breaks normalization rules.
Thanks for your time,
Simon
I'm new to the forum, struggling and would really appreciate some help with an Access Form problem.
I'm building a database that will track payments made to individuals.
Each single payment consists of multiple elements that, when added together, result in one cheque made payable to the person. These Payment Elements are currently 'Hotel Room', 'Travel', 'Food' and 'Honorarium'.
I'd like to track all the elements so that I can add up, say, all the Food costs for a period.
I've made tables similar to these:
tblPerson
ID, FirstName, Surname, DoB etc.
tblPayment
ID, PersonID, Date, Method, etc.
tblPaymentElements
ID, PaymentID, PaymentAmount, ElementType
tlbElementTypes
ID, Description
PaymentElements are the many side of a one-to-many with Payments. ElementTypes is just a lookup table for the descriptions ('Hotel Room' etc).ID, FirstName, Surname, DoB etc.
tblPayment
ID, PersonID, Date, Method, etc.
tblPaymentElements
ID, PaymentID, PaymentAmount, ElementType
tlbElementTypes
ID, Description
So now I'm stuck.
I'd like a sub-form that contains rows of Payments - one row for each payment. There would be text boxes for Date and then the four current Payment Element types and possibly some code that adds the payments to display the total.
I can't work out how to filter each Payment Element text box on the sub form so that the first one only shows the record for Payment Element Type 1 (Hotel), the second for Payment Element Type 2 (Travel), the third for Type 3 (Food) etc.
It's as if I need four different sub-forms within my sub-form - but that seems complicated! I must be able to filter for the PaymentElement ID - within the text box perhaps?
Am I on the right lines? My only other way I can think of is to create separate tables for each payment type - but I think that breaks normalization rules.
Thanks for your time,
Simon