473,395 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

help with relationships?

I've been working on an Access 2000 database for a couple of weeks now. I
took a course in access about a year ago, a crash course, and I learned a
ton, but I didn't touch Access for the year since then so I forgot
everything I learned : ( So this little project I envisioned has turned out
to be much harder than I thought. But I think I'm close with it, so I want
to see it through.

What I wanted to create is a database that will track my bill payments.
Personal bill tracking. I tried Quicken and MS Money demos and they are just
way more than I'd ever want/need, and quite honestly I don't think they do a
very good job of simple bill tracking/payments from a user standpoint. I was
keeping track of this stuff in Excel, but since I wanted to re-learn Access
I wanted to make something cool with this.

I *think* I finally got my table design correct (this is the 2nd
iteration...the first was basically a flat database, just one table!). So
here are the tables (primary key has asterisk next to it, foreign key has +
next to it):

tblPayees tblPayeeAccounts tblBills
tblBillPayments
*PayeeID *AccountID *BillID
*PaymentID
Payee Name AccountBalance Bill Name
*BillID
Payee Notes AccountInterestRate PaymentFrequency *PayeeID
+PayeeID BillPaymentAddr1
*AccountID

BillPaymentAddr2 PaymentDate

BillPaymentAddr3 PaymentAmountDue
BillCity
PaymentAmt
BillState
PaidIndicator
BillZIP
PaymentDueDate
BillNotes

BillPaymentMethod
+AccountID

BillDueDayofMonth

Note that tblBillPayments' primary key is a compound key among the four
indicated.
I also have lookup tables for PaymentFrequency, PaymentMethod, and
BillNames.

I think I have the above correct...I am probably wrong about that though.
Basically, each table is a one-to-many: One payee to Many Accounts; One
Account to Many Bills; One Bill to Many BillPayments.

I entered in test data and then used the form wizard to create a form that
does the following:
when I open it up, I want to have a combo-box that will allow me to select a
Payee Name. Then, the subforms below the main form will populate with the
Payee's associated accounts, bills, and bill payments.

I can't figure out what I'm doing wrong. I"ve tried everything I could think
of. I've gotten as far as being able to have what appears to be the right
form layout. When I open it up initially, I'll get the first Payee listed in
the combo-box, and the correct account/bill/billpayment info, but then I
couldn't select any other payees. Whenevr I set the source for the combo box
to Payee Name all I can select is the PayeeID, and when I do select the
PayeeID the sub-forms don't update with that PayeeID's information (its
associated account(s), bill(s), payments).

What am I doing wrong? ANY help would be greatly appreciated. Responses on
the NG would be great, but if you prefer I can be reached at
ma******@verizonTAKETHISOUT.net

Thanks so much in advance. I'm at my wits end with this.

mark

Nov 12 '05 #1
2 2533
Mark,

Your post garbled your table/field lists, but from what I can make
out, your table structure seems to be OK. I think your real problem is
with form synchronization.

Some quick pointers:

1. The combo box that selects the Payee name can't be bound to the
form's RecordSource. In other words, set the combo's ControlSource
property to nothing. Use a hidden text box to hold a copy of the
current PayeeID.

2. Synchronize your form's query to the combo box. To do this, design
the query that the form uses, and in the Criteria row under PayeeID,
put:

[Forms]![yourPayeeForm]![cboPayee]

This will restrict the records returned to the current cboPayee Value,
which should be set to be the PayeeID.

3. In the combo's AfterUpdate Event, requery your form. To do this,
select the Event tab in the combo's property box, and click the [...]
button next to After Update. Select Event Procedure, and enter a
single line in the routine:

Private Sub cboPayee_AfterUpdate()
Me.Requery
End Sub

Now, when you select a new Payee in the combo, only the records for
that PayeeID will be displayed in the form.

You should be able to adapt this common technique to the other forms
you need to synchronize.

-Ken

"mark" <ma******@comcast.net> wrote in message news:<bl************@ID-130190.news.uni-berlin.de>...
I've been working on an Access 2000 database for a couple of weeks now. I
took a course in access about a year ago, a crash course, and I learned a
ton, but I didn't touch Access for the year since then so I forgot
everything I learned : ( So this little project I envisioned has turned out
to be much harder than I thought. But I think I'm close with it, so I want
to see it through.

What I wanted to create is a database that will track my bill payments.
Personal bill tracking. I tried Quicken and MS Money demos and they are just
way more than I'd ever want/need, and quite honestly I don't think they do a
very good job of simple bill tracking/payments from a user standpoint. I was
keeping track of this stuff in Excel, but since I wanted to re-learn Access
I wanted to make something cool with this.

I *think* I finally got my table design correct (this is the 2nd
iteration...the first was basically a flat database, just one table!). So
here are the tables (primary key has asterisk next to it, foreign key has +
next to it):

tblPayees tblPayeeAccounts tblBills
tblBillPayments
*PayeeID *AccountID *BillID
*PaymentID
Payee Name AccountBalance Bill Name
*BillID
Payee Notes AccountInterestRate PaymentFrequency *PayeeID
+PayeeID BillPaymentAddr1
*AccountID

BillPaymentAddr2 PaymentDate

BillPaymentAddr3 PaymentAmountDue
BillCity
PaymentAmt
BillState
PaidIndicator
BillZIP
PaymentDueDate
BillNotes

BillPaymentMethod
+AccountID

BillDueDayofMonth

Note that tblBillPayments' primary key is a compound key among the four
indicated.
I also have lookup tables for PaymentFrequency, PaymentMethod, and
BillNames.

I think I have the above correct...I am probably wrong about that though.
Basically, each table is a one-to-many: One payee to Many Accounts; One
Account to Many Bills; One Bill to Many BillPayments.

I entered in test data and then used the form wizard to create a form that
does the following:
when I open it up, I want to have a combo-box that will allow me to select a
Payee Name. Then, the subforms below the main form will populate with the
Payee's associated accounts, bills, and bill payments.

I can't figure out what I'm doing wrong. I"ve tried everything I could think
of. I've gotten as far as being able to have what appears to be the right
form layout. When I open it up initially, I'll get the first Payee listed in
the combo-box, and the correct account/bill/billpayment info, but then I
couldn't select any other payees. Whenevr I set the source for the combo box
to Payee Name all I can select is the PayeeID, and when I do select the
PayeeID the sub-forms don't update with that PayeeID's information (its
associated account(s), bill(s), payments).

What am I doing wrong? ANY help would be greatly appreciated. Responses on
the NG would be great, but if you prefer I can be reached at
ma******@verizonTAKETHISOUT.net

Thanks so much in advance. I'm at my wits end with this.

mark

Nov 12 '05 #2
Mark,

Some more clarification:

When writing DB applications, you have to make a distinction between
user controls and data controls:
* User controls run the application. Buttons like "Save", "Close" or
"Open Report" are examples. These controls are not bound to data.
* Data controls allow the user to edit the data. They are ultimately
bound to a particular field in a particular table.

Your combo box allows the user to select another payee, and causes the
form to requery to display the appropriate data. Therefore, it is a
user control, and shouldn't be bound to any data. Since you have two
subforms, your code might look more like this:

Private Sub cboPayee_AfterUpdate()
Me.Requery
yourSubForm1.Requery
yourSubForm2.Requery
End Sub

(Actually, if you set the Link Child and Link Master Fields properties
properly for the subforms, the two subform Requery lines aren't
necessary)

Also, I was using a common convention in these groups when I chose my
form and control names. Since I didn't know the actual names, I made
up my own. Using this convention, it is implied that you will replace
"yourPayeeForm", "yourSubForm1" and "cboPayee" with the actual names
of your forms and controls.

It is hard to avoid using VBA code when building your DB app.
Fortunately, you can get away with using very little.

Now that we're discussing VBA, its time to touch on more conventions.
The VB and Access programming communities have come up with naming
conventions to make programs easier to understand by providing context
information. This takes the form of 1 to 3 letter prefixes, which give
you clues about what is being worked with. Here is a (partial) list:

txt - Text Box
cbo - Combo Box
frm - Form
lbl - Label
cmd - Command Button

cboPayee was so named to make it clear in code that we are dealing
with a combo box. You can do a search on "Naming Convention" in this
group and learn a lot more.

Building your first DB app can be a challenge. All I can offer is: be
persistent. Keep using the help files, searching the Internet, and
researching these groups. You will get there, although maybe not as
fast as you'd like.

-Ken

ki*****@texassystems.com (Ken Ismert) wrote in message news:<c7**************************@posting.google. com>...
Mark,

Your post garbled your table/field lists, but from what I can make
out, your table structure seems to be OK. I think your real problem is
with form synchronization.

Some quick pointers:

1. The combo box that selects the Payee name can't be bound to the
form's RecordSource. In other words, set the combo's ControlSource
property to nothing. Use a hidden text box to hold a copy of the
current PayeeID.

2. Synchronize your form's query to the combo box. To do this, design
the query that the form uses, and in the Criteria row under PayeeID,
put:

[Forms]![yourPayeeForm]![cboPayee]

This will restrict the records returned to the current cboPayee Value,
which should be set to be the PayeeID.

3. In the combo's AfterUpdate Event, requery your form. To do this,
select the Event tab in the combo's property box, and click the [...]
button next to After Update. Select Event Procedure, and enter a
single line in the routine:

Private Sub cboPayee_AfterUpdate()
Me.Requery
End Sub

Now, when you select a new Payee in the combo, only the records for
that PayeeID will be displayed in the form.

You should be able to adapt this common technique to the other forms
you need to synchronize.

-Ken

"mark" <ma******@comcast.net> wrote in message news:<bl************@ID-130190.news.uni-berlin.de>...
I've been working on an Access 2000 database for a couple of weeks now. I
took a course in access about a year ago, a crash course, and I learned a
ton, but I didn't touch Access for the year since then so I forgot
everything I learned : ( So this little project I envisioned has turned out
to be much harder than I thought. But I think I'm close with it, so I want
to see it through.

What I wanted to create is a database that will track my bill payments.
Personal bill tracking. I tried Quicken and MS Money demos and they are just
way more than I'd ever want/need, and quite honestly I don't think they do a
very good job of simple bill tracking/payments from a user standpoint. I was
keeping track of this stuff in Excel, but since I wanted to re-learn Access
I wanted to make something cool with this.

I *think* I finally got my table design correct (this is the 2nd
iteration...the first was basically a flat database, just one table!). So
here are the tables (primary key has asterisk next to it, foreign key has +
next to it):

tblPayees tblPayeeAccounts tblBills
tblBillPayments
*PayeeID *AccountID *BillID
*PaymentID
Payee Name AccountBalance Bill Name
*BillID
Payee Notes AccountInterestRate PaymentFrequency *PayeeID
+PayeeID BillPaymentAddr1
*AccountID

BillPaymentAddr2 PaymentDate

BillPaymentAddr3 PaymentAmountDue
BillCity
PaymentAmt
BillState
PaidIndicator
BillZIP
PaymentDueDate
BillNotes

BillPaymentMethod
+AccountID

BillDueDayofMonth

Note that tblBillPayments' primary key is a compound key among the four
indicated.
I also have lookup tables for PaymentFrequency, PaymentMethod, and
BillNames.

I think I have the above correct...I am probably wrong about that though.
Basically, each table is a one-to-many: One payee to Many Accounts; One
Account to Many Bills; One Bill to Many BillPayments.

I entered in test data and then used the form wizard to create a form that
does the following:
when I open it up, I want to have a combo-box that will allow me to select a
Payee Name. Then, the subforms below the main form will populate with the
Payee's associated accounts, bills, and bill payments.

I can't figure out what I'm doing wrong. I"ve tried everything I could think
of. I've gotten as far as being able to have what appears to be the right
form layout. When I open it up initially, I'll get the first Payee listed in
the combo-box, and the correct account/bill/billpayment info, but then I
couldn't select any other payees. Whenevr I set the source for the combo box
to Payee Name all I can select is the PayeeID, and when I do select the
PayeeID the sub-forms don't update with that PayeeID's information (its
associated account(s), bill(s), payments).

What am I doing wrong? ANY help would be greatly appreciated. Responses on
the NG would be great, but if you prefer I can be reached at
ma******@verizonTAKETHISOUT.net

Thanks so much in advance. I'm at my wits end with this.

mark

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Joe | last post by:
I'm designing a company website. I'm relatively new to CSS and I'm having trouble creating what seems to me a very simple design: - body background: fixed full page image - banner: fixed, 100...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
21
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest...
20
by: Ed | last post by:
I am running Access 2002 and just ran the built in Access wizard for splitting a database into a back end (with tables) and front end (with queries, forms, modules, etc.). After running the...
2
by: James | last post by:
Hello all, In my music library database I have my stock categorised by media type; the types of media are: audio, book and score. My score type is the one I'm having difficulty with. Each...
6
by: Raji16 | last post by:
Hi, I am a new member. i am designing a simple judicial database system. however after creating tables i am a bit confused on setting the relationships between tables :confused: here is the link...
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
5
by: Kosmos | last post by:
Hey :) hopefully someone can help me with this...I decided to take on the task of programming an access database for my legal co-op/internship...I'm studying law and music production on the...
1
by: loner | last post by:
hey guys check dis link http://lonerattimessquare.blogspot.com/ maybe you all can help me build a reationship
13
by: ARC | last post by:
Hello all, Prior to going live with my app, I have questions on relationships theory. My prior app was done in Access 97, and I did NOT use relationships at all. I have 65 tables in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.