Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

How to ensure record completed before creating another

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
terry.statham@gmail.com - 23 Jan 2006 22:34 GMT
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
MGFoster - 24 Jan 2006 00:18 GMT
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.
Signature

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

> Hope someone can help me here.
>
[quoted text clipped - 23 lines]
> fields in record one are filled in or can someone suggest a better way
> of solving this.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.