Hey there! Sign in to join this conversationNew here? Join for free
Turn on thread page Beta
    • Thread Starter
    Offline

    0
    ReputationRep:
    Hey all, (I'm new, go easy on me )

    Just been creating the database in Access for CPT3 but I've become stuck.

    I've got four tables: Car, Company, Tyre and Fitting.

    I've created forms for the first three tables and everything works great. I'm now trying to create a form to record each fitting (and from that I will generate an invoice).

    For the fitting form, i've got a query which links the other three tables, my ER diagram is:

    Company ---> Car --> Fitting
    |
    |
    Tyre

    and each link is a one to many relationship.

    I've got the query and form working but I'm now trying to create a macro that automatically updates the car details with:

    last fitted date
    amount of tyres last fit
    comments
    last mileage

    I can get the mileage and comments updated without a macro as I just input the details directly in the form. However for the other two, Access keeps coming up with errors saying "Field cannot be updated"

    I can't even update them if I open up the query as a datasheet and directly type the values into the fields.

    The fields aren't locked so I don't understand. I've got a sneaky feeling it is to do with the relationships but I'm not sure.

    *shrugs*

    Any help is greatly appreciated!
    Offline

    0
    ReputationRep:
    last fitted date
    amount of tyres last fit
    comments
    last mileage

    have you considered moving these fields from the car table into the fitting table? There would be a date, amount of tyres fitted, optional comment and mileage for each fitting, rather than just the latest ones for the car in general.
    • Thread Starter
    Offline

    0
    ReputationRep:
    No, they aren't foreign keys.

    I thought about putting them on to the Fittings table too but the specification for CPT3 says that the, actually, no..


    let me start that again;

    the spec says that the last fitting date for each car is added at the time of fitting. I need this field to be on the car table as I need to be able to create a query that shows cars which last had a tyre fitting over 12 months ago.

    Anyway (should have said this earlier), I've managed to fix the problem.

    I created the query again and made it identical to the query mentioned in earlier and for some reason it has actually fixed it. I think that Access glitched and caused the problem, rather than there being a problem with my Tod's Tyres system.

    Thanks for the help anyway!
 
 
 
Poll
“Yanny” or “Laurel”

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.