Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 23rd, 2006, 10:45 PM
terry.statham@gmail.com
Guest
 
Posts: n/a
Default How to ensure record completed before creating another

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

  #2  
Old January 24th, 2006, 12:25 AM
MGFoster
Guest
 
Posts: n/a
Default Re: How to ensure record completed before creating another

-----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-----


terry.statham@gmail.com wrote:[color=blue]
> 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.[/color]
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles