By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

How to ensure record completed before creating another

P: n/a
Hope someone can help me here.

I am fairly new to Access. I have set up a database relating to vehicle
movements prior to sale. I have a subform based on 'locations' table
which is linked to my main 'vehicles' tables through vehicleID.

Table 'Locations' has the following fields; LOcationID(PK), VehicleID,
Location, DateDueIn, ActualDateIN, DateDueOut, ActualDateOut.

I have set up form validation rules so that no dates can be entered
unless a location is present, Actualdatein cannot be entered unless
duedatein is entered. Datedueout cannot be entered unless actualdatein
is entered and actualdateout cannot be entered unless datedueout is
entered.

Vehicles can have up to 4 or 5 movements to various locations. However,
how it is set up at the moment, nothing prevents me from entering a
second record even though the first record has not been fully
completed. For example record one can show location and the first three
dates completed, but no date out entered. I can then create a new
record which can show an actual date in and therefore the vehicle shows
as being in 2 locations at the same time as record one does not have an
actual date out!!

Is there a way to prevent creation of a second record until all the
fields in record one are filled in or can someone suggest a better way
of solving this.

Hope this makes sense !

Thanks

Terry

Jan 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In the Location form's BeforeUpdate event run a query that checks for
any missing Actual Date Out for the current record's Vehicle ID (make
sure you don't include the current record in the check). If there are
any other records that have a NULL Actual Date Out then set Cancel =
True & the current record won't be saved. You can add a MsgBox to
inform the user of what went wrong.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9VyUIechKqOuFEgEQJzwwCg7CLyMlyrmT5lqEw1uh+rC+ msuf0AoOtL
wU70s7hGVPWSbT2Ck9VlhAaN
=BB8f
-----END PGP SIGNATURE-----
te***********@gmail.com wrote:
Hope someone can help me here.

I am fairly new to Access. I have set up a database relating to vehicle
movements prior to sale. I have a subform based on 'locations' table
which is linked to my main 'vehicles' tables through vehicleID.

Table 'Locations' has the following fields; LOcationID(PK), VehicleID,
Location, DateDueIn, ActualDateIN, DateDueOut, ActualDateOut.

I have set up form validation rules so that no dates can be entered
unless a location is present, Actualdatein cannot be entered unless
duedatein is entered. Datedueout cannot be entered unless actualdatein
is entered and actualdateout cannot be entered unless datedueout is
entered.

Vehicles can have up to 4 or 5 movements to various locations. However,
how it is set up at the moment, nothing prevents me from entering a
second record even though the first record has not been fully
completed. For example record one can show location and the first three
dates completed, but no date out entered. I can then create a new
record which can show an actual date in and therefore the vehicle shows
as being in 2 locations at the same time as record one does not have an
actual date out!!

Is there a way to prevent creation of a second record until all the
fields in record one are filled in or can someone suggest a better way
of solving this.

Jan 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.