f



Help setting up Ms-Access Database

I'm hoping that someone here can give me some assistance with a
database I'm trying to set up. My skills in Access are fairly basic,
and I'm trying to skill up, but some of the stuff is a little opaque.

I'm trying to put some data I've got on paper into Access. Recently,
I
got together with some other people marketing organic produce and
offered to do some marketing for us on a coop basis in the city.


The idea I had was to have four marketing packages for coop members
with different rates and services. For want of something better lets
call them P1, P2, P3 & P4


I'm thinking I'll need a table with the packages, and one listing the
coop members with their details. In theory, a coop member might
acquire another farm (either a new one or one from someone bailing
out) and put it on a separate package.


Which tables would have to have a relationship?


I'm thinking the packages table containing the dat about each package
would have to be related via a common field to the coop member table,
and there would probably have to be a link between that and the farm
table, through common fields -- maybe a unique ID in the coop member
table could appear in the farm table and maybe the primary key from
the package table could also appear in the farm table as a foreign
key. But am I right?


I'd also like to create a form that would list an individual coop
member's details plus any packages they own and assume that all I'd
need to do would be to ensure that there was a specified report for
the form to call. Is that right? Is 'switchboard manager' the way to
go here?


I'd also like to create a macro to automatically open the database.
I've had a bit of a look through Access and maybe I've missed it, but
could someone point me in the right direction?


Thanks in advance ...


JD


PS Further to this, it occurs to me that if I'm going to permit coop
members to have more than one package then maybe I need some sort of
transactions table in which the records would be packages actually
taken out. Each record could contain the ID from the relevant farm
(the transactions table being the 'one' and the farm being the many)
and an ID from the packages table (eg P1 to P4) where the
transactions
table could be the many.

Am I in a muddle here or on the right track?


JD

PPS ... Bob Badour suggested I clarify the following questions:

"How many packages can a farm have? "

only 1


"How many packages can a coop member have?"

in theory, unlimited, although only one per farm


"How many farms can a coop member have?"


in theory, unlimited


"How many coop members can a farm have?"


just one


Any assistance would be greatly valued.

JD

0
jpm1121 (3)
12/3/2007 12:12:42 AM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

4 Replies
877 Views

Similar Articles

[PageSpeed] 38

On Dec 3, 11:12 am, Jeffrey Davis <jpm1...@gmail.com> wrote:
> I'm hoping that someone here can give me some assistance with a
> database I'm trying to set up. My skills in Access are fairly basic,
> and I'm trying to skill up, but some of the stuff is a little opaque.
>
> I'm trying to put some data I've got on paper into Access. Recently,
> I
> got together with some other people marketing organic produce and
> offered to do some marketing for us on a coop basis in the city.
>
> The idea I had was to have four marketing packages for coop members
> with different rates and services. For want of something better lets
> call them P1, P2, P3 & P4
>
> I'm thinking I'll need a table with the packages, and one listing the
> coop members with their details. In theory, a coop member might
> acquire another farm (either a new one or one from someone bailing
> out) and put it on a separate package.
>
> Which tables would have to have a relationship?
>
> I'm thinking the packages table containing the dat about each package
> would have to be related via a common field to the coop member table,
> and there would probably have to be a link between that and the farm
> table, through common fields -- maybe a unique ID in the coop member
> table could appear in the farm table and maybe the primary key from
> the package table could also appear in the farm table as a foreign
> key. But am I right?
>
> I'd also like to create a form that would list an individual coop
> member's details plus any packages they own and assume that all I'd
> need to do would be to ensure that there was a specified report for
> the form to call. Is that right? Is 'switchboard manager' the way to
> go here?
>
> I'd also like to create a macro to automatically open the database.
> I've had a bit of a look through Access and maybe I've missed it, but
> could someone point me in the right direction?
>
> Thanks in advance ...
>
> JD
>
> PS Further to this, it occurs to me that if I'm going to permit coop
> members to have more than one package then maybe I need some sort of
> transactions table in which the records would be packages actually
> taken out. Each record could contain the ID from the relevant farm
> (the transactions table being the 'one' and the farm being the many)
> and an ID from the packages table (eg P1 to P4) where the
> transactions
> table could be the many.
>
> Am I in a muddle here or on the right track?
>
> JD

Ok ,,, I've done the above ... not perfect but workable (still haven't
figured out how to create the macro) ,,,

but I'm trying to build a query that calculates the sum of a number of
records selected by the meeting the value of another field.

I keep getting type mismatches when I try to insert the criterion.

If I better specified (eg by specifying the fuill field and table name
in the correct syntax), would this work?

TIA

JD

0
jpm1121 (3)
12/3/2007 4:15:53 AM
On Sun, 2 Dec 2007 20:15:53 -0800 (PST), Jeffrey Davis
<jpm1121@gmail.com> wrote:

Show us your query and the data types of the fields involved. The
error message seems to indicate you're doing something that violates
the data type rules. E.g. Sum(FirstName) would trigger this error, or
"...where FirstName=Tom" (because the quotes are missing).

To start your application, set a startup form, or create an AutoExec
macro.

-Tom.

<clip>
>
>Ok ,,, I've done the above ... not perfect but workable (still haven't
>figured out how to create the macro) ,,,
>
>but I'm trying to build a query that calculates the sum of a number of
>records selected by the meeting the value of another field.
>
>I keep getting type mismatches when I try to insert the criterion.
>
>If I better specified (eg by specifying the fuill field and table name
>in the correct syntax), would this work?
>
>TIA
>
>JD
0
12/3/2007 9:06:50 AM
On Dec 3, 8:06 pm, Tom van Stiphout <no.spam.tom7...@cox.net> wrote:
> On Sun, 2 Dec 2007 20:15:53 -0800 (PST), Jeffrey Davis
>
> <jpm1...@gmail.com> wrote:
>
> Show us your query and the data types of the fields involved. The
> error message seems to indicate you're doing something that violates
> the data type rules. E.g. Sum(FirstName) would trigger this error, or
> "...where FirstName=Tom" (because the quotes are missing).
>
> To start your application, set a startup form, or create an AutoExec
> macro.
>
> -Tom.
>
> <clip>
>
>
>
>
>
> >Ok ,,, I've done the above ... not perfect but workable (still haven't
> >figured out how to create the macro) ,,,
>
> >but I'm trying to build a query that calculates the sum of a number of
> >records selected by the meeting the value of another field.
>
> >I keep getting type mismatches when I try to insert the criterion.
>
> >If I better specified (eg by specifying the fuill field and table name
> >in the correct syntax), would this work?
>
> >TIA
>
> >JD- Hide quoted text -
>
> - Show quoted text -

I've just used the standard query app..

When it's run, it accurately extracts the relevant records with the
sales figures displayed for each of them.

SELECT package.Type, farms.Location, farms.farmID, farms.State,
farms.Sales
FROM farms INNER JOIN (coopMember INNER JOIN (package INNER JOIN
agreements ON package.Type = agreements.package) ON
coopMember.coopMemberID = agreements.coopMember) ON farms.farmID =
agreements.Restaurant
GROUP BY package.Type, farms.Location, farms.farmID, farms.State,
farms.Sales
HAVING (((package.Type)="p1"))

I tried to write some script to sum the three extracted records (i.e
all those with p1 as the value of the package type) in a new column,
but no dice.


In Excel, this would be fairly easy as you'd simply write an IF
referenced to the column with the p values specifying p1 and then sum
them at the bottom of the column, but in Access ...

Thanks.

JD





0
jpm1121 (3)
12/3/2007 10:17:19 AM
Jeffrey Davis wrote:
> On Dec 3, 8:06 pm, Tom van Stiphout <no.spam.tom7...@cox.net> wrote:
> 
>>On Sun, 2 Dec 2007 20:15:53 -0800 (PST), Jeffrey Davis
>>
>><jpm1...@gmail.com> wrote:
>>
>>Show us your query and the data types of the fields involved. The
>>error message seems to indicate you're doing something that violates
>>the data type rules. E.g. Sum(FirstName) would trigger this error, or
>>"...where FirstName=Tom" (because the quotes are missing).
>>
>>To start your application, set a startup form, or create an AutoExec
>>macro.
>>
>>-Tom.
>>
>><clip>
>>
>>
>>
>>
>>
>>>Ok ,,, I've done the above ... not perfect but workable (still haven't
>>>figured out how to create the macro) ,,,
>>
>>>but I'm trying to build a query that calculates the sum of a number of
>>>records selected by the meeting the value of another field.
>>
>>>I keep getting type mismatches when I try to insert the criterion.
>>
>>>If I better specified (eg by specifying the fuill field and table name
>>>in the correct syntax), would this work?
>>
>>>TIA
>>
>>>JD- Hide quoted text -
>>
>>- Show quoted text -
> 
> 
> I've just used the standard query app..
> 
> When it's run, it accurately extracts the relevant records with the
> sales figures displayed for each of them.
> 
> SELECT package.Type, farms.Location, farms.farmID, farms.State,
> farms.Sales
> FROM farms INNER JOIN (coopMember INNER JOIN (package INNER JOIN
> agreements ON package.Type = agreements.package) ON
> coopMember.coopMemberID = agreements.coopMember) ON farms.farmID =
> agreements.Restaurant
> GROUP BY package.Type, farms.Location, farms.farmID, farms.State,
> farms.Sales
> HAVING (((package.Type)="p1"))
> 
> I tried to write some script to sum the three extracted records (i.e
> all those with p1 as the value of the package type) in a new column,
> but no dice.

In the Totals row of the query builder (where you see all those 
GroupBys), have you considered changing the Sales column from GroupBy to 
Sum?

> 
> 
> In Excel, this would be fairly easy as you'd simply write an IF
> referenced to the column with the p values specifying p1 and then sum
> them at the bottom of the column, but in Access ...
> 
> Thanks.
> 
> JD
> 
> 
> 
> 
> 
0
oil (4047)
12/3/2007 1:24:46 PM
Reply: