How to update a certain record with a checkbox

T

TODDAV8R

I'm pretty much new to all this, so if this question appears to have been
written by a complete rookie at writing VB code, well...that's because it is.
I am trying to figure how to update a field of a certain record in a table by
checking a box in a form.

I don't know how to break this down in Access or VB programming terms, so
I'll just lay it out.

I track the status of 21 aircraft. The AIRCRAFT table has 21 records. One
of the fields in the AIRCRAFT table is "Last Fly Date". I have another form
called DAILY RECAP INPUT, along with it's associated table of the same name,
in which the primary key is the date of flying, and I enter various data
about that days flying (# flights scheduled, # flights flown, # flight hours,
etc.). Also on the DAILY RECAP INPUT form is 21 checkbox's (yes/no)
representing all the aircraft tail numbers, with the idea of checking those
aircraft to flew on that day. So I end up with a record in the Daily Recap
Table with 21 columns of checkboxes, some checked, some not, on a certain
date.

What I have tried to do is write code that "On Click" of an aircraft's
checkbox, the Last Fly Date in the aircraft table is updated to that day for
that aircraft. But I give up....does any of this make sense?

PLEASE HELP!!!

Todd
 
A

Allen Browne

Todd, this needs to be redesigned in a relational way.

Instead of the Daily Recap Input table, you need:
- the Aircraft table you have (with an AirCraftID primary key),
- a Pilot table (one record for each person, with PilotID primary key),
- a Flight table (one record per flight), with these fields:
FlightID AutoNumber
AircraftID relates to Aircraft.AircraftID
FlightDateTime Date/Time (start-up or take-off time)
Duration Number (flight duration in minutes)
PilotID relates to Pilot.PilotID

Now you have this relational structure, you can create a crosstab query to
show you a view of the data that looks like your Daily Recap Input table.
 

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