Getting Started?

E

Eric

I am new to writing MS Access so bear with me if questions are basic or not
worded right and try to keep answers fairly simple.

How do I accomplish this?
I want to make an Access database with multiple tables and forms, starting
fairly simple...

I want one table to store accounts so I designed it (Accounts table) with
these fields:
ID (autonumber) (primary key)
Company (text) (must be unique)
Account Number (text) (must be unique by company)

I want another table to enter payments so I designed it (Payments table)
with these fields:
ID (text) (relates to ID field on Accounts)
Sequence (autonumber) (primary key)
Date (simple date type)
Amount (currency)

I went to Forms and tried to create a form in design view, but I didn't see
where to connect it to the data fields.
I created a form using the wizard and connected it to the Accounts table and
got a simple form for entering account numbers.
I tried to create a second form to enter payments, but I don't see how to
tie the form to multiple tables, to create a list button of company names
and input controls for date and amount.
I tried creating a query to tie the 2 tables together and selecting the
query on creating a form in the wizard, and it didn't list any fields.

I'm assuming I designed the tables correctly. The key on the Payments table
is ID + Sequence, to enter multiple payments for each date, by company, but
it only lets you select one field for the key.
I tried to use the ... on the Record Source field of the Properties for a
form to tie both tables to one form, and it said I couldn't connect the
tables with ID because the field must be the same type. When I tried to get
around that, I managed to get a select statement in the Record Source, then
there were no fields in the Control Source list for the controls on that
form.
 
E

Ed Robichaud

For new to Access, you got close.
Your tables (slightly modified):

tblAccounts (this works only if every company will only have 1 acct)
AcctID (autonumber) (primary key)
Company (text) (must be unique)
Account Number (text) (must be unique by company)

tblPayments
PaymentID(autonumber) (primary key)
AcctID (number -long integer) foreign key (relates to AcctID field on
Accounts) required, indexed, non-unique
Date (simple date type) indexed, required, indexed, non-unique
Amount (currency) required

Go to "Tools-Relationships" and set a 1-Many relation between tblAccts and
tblPayments

A very common form display for this would be a single-type Main form based
on tblAccounts and a related datasheet-style Subform based on tblPayments.
Look at the Northwind or template examples of how to set this up.
-Ed
 

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

Top