473,383 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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

Jan 23 '06 #1
1 1718
-----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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: AJ | last post by:
record_id Status Due_date 549 In Progress 2004-06-02 00:00:00.000 549 Not Started 2004-06-07 00:00:00.000 549 Not Started 2004-06-08 00:00:00.000 549 Waiting 2004-05-31...
1
by: Tony | last post by:
I have a form in access that has 5 fields for a certain record: 1)Date mailed, 2)Date received, 3)Date completed 4)Foreign Content amount and 5)record number. If the foreign content (FC)is >15% of...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
2
by: Melissa | last post by:
I have a single (not continuous) form with an Undo button for entering finished projects. On the form is also a subform that lists all finished projects for reference. When I enter the...
3
by: Sarah Smith via AccessMonster.com | last post by:
I am creating a database of documents that need to be worked on, are int eh proress of being worked on, and have been completed. Sometimes the same document (an updated version) comes back for more...
0
by: steve | last post by:
Hi all, Come across a situation I cannot figure how to work out. Im relatively new to access but have looked around and tried everything to my knowledge. I've developed an application whereby...
1
by: ILCSP | last post by:
Hello, I'm trying to accomplish 3 things with one stored procedure. I'm trying to search for a record in table X, use the outcome of that search to insert another record in table Y and then exec...
1
by: kimmccain | last post by:
I have a form with two buttons, Completed and Pended. When the completed button is clicked, the record is moved to the completed table and the form's record is decreased by 1. When the pended...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.