sure something wrong with query - too many primary keys but need t

B

babs

The record source is a query and no I can not add anything to the rate field
in datasheet view.
Also the deliv name and pickupname are automatically input with a Dlookup on
the form and on the query they are not updateable either.

Just reexplaining tables from previous post.

I have 3 tables

CLIENTTABLE
clientid-PK
clientnumb
clientname
address
state
etc

TBLTANKRATES2
rateid
clientid-pk
pickupyd-pk
pickupydname-pk
delivyd-pk
delivydname-pk
typeofmat-pk
rate

TANKTICKETENTRY
clientid-pk
ticket-pk
servicedate
typeofmat
pickupdyd
delivyd
truck#
gross weight
comment

I need to grab the rate value from the tanksrate2 table where the
clientid,pickupyd, pickupydname, delivyd, delivydname, and typeofmat are the
same.

Joins for query are as follows
clienttable (clientid-clientid)tankticketentry (innerjoin)

Had to do Outerjoins with all the Primary keys to make the query updateable
-any ideas????

tbltankrates2 (clientid-clientid)tankticketntry (Outerjoin - Include all
records from 'TankTicketEntry' and only those records from 'tblTanksRate'
where joined fields are equal

tbltankrates2 (pickupyd-pickupyd)tankticketntry (Outerjoin - Include all
records from 'TankTicketEntry' and only those records from 'ClientTable'
where joined fields are equal


tbltankrates2 (delivyd-delivyd)tankticketntry (OuterJoin- same as above)
tbltankrates2 (pickupydname-pickupydname)tankticketntry (OuterJoin- same as
above)
tbltankrates2 (delivydname-delivydname)tankticketntry (OuterJoin- same as
above)
tbltankrates2 (typeofmat-typeofmat)tankticketntry (OuterJoin- same as above)

The query worked fine except there may is a situation where there is a
pickup yd with the same # but different pickupydname and same for deliv.

So I made the pickupydname and delivydname primary keys also in the tankrate2
table and now the query is not updatable.

Not sure how to lay this out.

The rate is not a calculated field just based on the clientid,
pickupyd,pickupydname,delivyd,delivydname, and typeofmat. want on the form
based on this query for the rate to automatically fill in based on all of
these items.

On the Form the Textboxes are as follows

textbox fieldname
cboClientid Clientid
clientname clientname(automatically dumped in)
tankmat tankmat(dropdown of 2 choices)
cbopickupydnumb populate an sql after update event based on the clientid
selected
want to only see pickupydnumb from tbltanksrate
that have this clientid so don't have to see ALL
pickupydnumb
cbidelivydnumb same as pickupydnumb(populate based on client id selected)
txtPickkupydname want it to be automatically put in after select drop down
and if two
#15 pickupd yard want correct NAME of one I
select from drop down. right now just grabs 1st one
it sees.
txtdelivydname same as previous

after all of these items are input (on the form)it should grab the rate
field from the
tbltanksrate2 table(query) field name and text box is RAte.

Thanks for your help,
Barb
 

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