Data Validation Between Two Tables

Dec 1, 2004

Hi there!

I wonder if someone can help me please? I have an Access 2000 database used to record the daily treatments received by patients in our Intensive Care Unit. The database consists of 2 tables;

Table 1 has these fields; [First Name], [Surname], [Hospital Number], [ICU Admission Number] (Primary Key), [Date of admission], [Date of discharge].

Table 2 has these fields; [Date], [ICU Admission number], and various treatment fields requiring a true or false response.

The tables are linked through the [ICU Admission Number] field.

I enter data in the first instance through Table 1 and then click on the '+' in the far left hand column to access Table 2 for each record (Patient), whereupon I enter the daily treatments - each record in this table accounting for 1 day on the unit (i.e. there must be no duplicate values).

When I open Table 2 I need three things to happen to try and avoid mistakes being made.

(1) The first record in the [Date] field must only be equal to the [Date of admission] in Table 1. It must not be possible to enter anything else

(2) In subsequent records in Table 2 the date must increase by one day until it equals the [Date of discharge] in Table 1.

(3) Once this value has been reached it must not be possible to enter subsequent dates or duplicate dates.


If anybody can help me with this query I would be delighted to hear from you. I have tried fiddling around with Validation rules but have had no luck.

If you can help then that would be fantastic.

Best regards
Usr33t

View Replies


ADVERTISEMENT

Tables :: Data Validation Using Excel Spreadsheet

Nov 26, 2012

How can I validate data using an excel spreadsheet?

I have a table with Product information, I want only the ProductId that are in the spreadsheet to be used in the database. How can I check the ProductID entered in the form actually exists in the excel spreadsheet?

View 1 Replies View Related

Tables :: Set Up Validation Of Fields Unit And Size Based On Another Fields Data?

Nov 18, 2013

Basically in my order details table i have the following fields

Product
Unit
Size

At the moment i have the Product field with a dropdown that gives me all the products from my ProductT. But once i choose the correct product in the unit field it gives me all the possibilities of every product not just the units associated with that product. ie

ProductT
Grasshopper Box1000 Adult
Grasshopper Box1000 Subadult
Worm 10pz Big

When I select the grasshopper product and move on to the unit field i also get "10pz" option but this is not a product available.

How do i set up validation of the fields Unit and size based on another fields data?

View 4 Replies View Related

Tables :: Validation Within A Table?

Nov 7, 2012

I am trying to validate attendance at an event. If there is a no show indicator set to Yes, then attendance must be zero. If there is a no show indicator set to No, then attendance must be greater than zero. No show indicator is in same table with attendance.

View 14 Replies View Related

Tables :: Validation Rule In Between Two Dates?

Feb 22, 2013

What would the validation rules be between two dates:

>01/09/07 however <01/09/11
and also
>01/09/07 however <present day

View 2 Replies View Related

Tables :: Validation Rule For One Of Fields

Jan 13, 2015

I am trying to create a validation rule for one of my fields.. i want it to be so that the user can not select a date to be on a Sunday..

View 2 Replies View Related

Tables :: Odd / Even Validation Rule Between Two Fields

May 3, 2013

I am building a scoring system for an Archery Tournament and am trying to add some extra validation between two fields.I want to check the contents of one field against another.So if Field A has an even value, then Field B must also be even, and if Field A has an Odd value, Field B must be odd.Would it also be possible to add an exception such that if Field B = 0 then the validation rule does not apply?I am only a very occasional user of Access, and don't have a very good grasp of the code structure in it, but am prepared to try and learn.

View 4 Replies View Related

Tables :: Validation Rule For Date

Dec 1, 2012

I have a table with 2 field:

1. StartDate (format : Short Date)
2. EndDate (format : Short Date)

How can I validate for field EndDate must occur after StartDate using Validation Rule?

View 2 Replies View Related

Data Validation

Dec 14, 2004

Hi!

I have a Question about validation rules. I have a table with a field where the values can either be 3 numbers (like 321,245) or 4numbers separated by . (like 321.4). Other employees update these fields so it is importatant that they can't put in text etc.
In the field for validationrule I put the text (Select Distinct [fieldname] from table) but that did not work. Do anybody know an easy way to set the validation rule?

Thanks :eek:

View 1 Replies View Related

Data Validation - HELP!

Feb 22, 2005

I am trying to validate a text field (named Customer_Surname) and i want to make it so that only letters can be entered into the field and no other numbers or symbols. Is there any way this vlaidation can be done and if so, how?

Cheers

View 1 Replies View Related

Tables :: Create A Field Validation Rule?

Mar 25, 2014

I want to create a field validation rule that requires the user to input a policy number in a standard format. The format has a fixed length of 13 with three underlying components. The first 3 digits identify coverage, the next 7 are the policy number and the final three must always be "-00".

Example: GLO1234567-00

Is it possible to create a validation rule for this ? If so, can you provide the code based on the simple example above ?

View 4 Replies View Related

Tables :: Table Validation Rule - IIF Statement

Feb 27, 2014

I cant figure out a fairly simple IIF statement I need for a table validation rule. I'll try to explain:

I have 2 fields in a table that are controlled through a form, which sets the fields either true (-1) or false (0). Lets call them Field1 and Field2. These fields need a validation rule which is dependent on FieldX and FieldY.

When FieldX = FieldY, I need Field1 to be either 0 or -1

if Field1 is 0 -> Field2 is -1 and the other way around.

if FieldX <> FieldY -> Field1 = 0 and Field2 = 0

View 1 Replies View Related

Data Validation In A Table

May 9, 2007

I am trying to validate data in a table.

I have two fields, status and completion date.

What I want is the following:
If [status] field = "Complete" then [completion date] cannot be null.

I don't know if doing this in a table of the form is best using the forms Before Update Event, but I am having trouble figuring how to write it using the expression builder.

Can anyone help or offer suggestions?

View 8 Replies View Related

Data Validation - Certain Weekday

Oct 30, 2007

I have a table embedded in a form that data is entered on. The data to be entered is a project number, date, and a numerical value. I want the date to be entered only be on a Sunday. Is there a data validation rule to apply or do I need to use VBA? I do not know VBA!

View 3 Replies View Related

Validation Of Data In A Column.

Apr 12, 2008

Hello,

I am want to validate the data in a table column as per the data in a corresponding column in teh same table.

Ex. I have a table with column "Frequency" of datatype Text.
And other 12column are in the name of the months. i.e. Jan, Feb etc of datatype "Yes/No" in checkbox format. Default value as false.

I have only 4 different values i.e. Yearly, Half Yearly, Quarterly And Monthly.

If the value is Yealy then I should able to change the value on Only "Jan" from False to True.

Similarly If the value is Yearly then I should able to change the value on Only "Jan" & "July" from False to True.

Same holds true for Quarterly changing the values only of March, June, Sep & Dec from false to true.

Can anyone guide me to do this would be great.

Thanks
Sudhir

:(:(:confused:

View 4 Replies View Related

Data Validation Problem

May 16, 2005

Hi,

I am using the following validation code for the part number field on one of my forms:


DLookUp("[Door Part Number]","2-MAIN DOOR PART DATABASE","[Door Part Number] = '" & [Door_Part_Number] & "'") Is Null And Not ""

The purpose of this is to prevent users from changing/creating parts with a number that already exists in the database (and the last bit prevents no part number being entered).

It is fine for most situations except 1. If the user changes a part number, then changes it back to the original number again, the validation rule thinks this already exists and forces the user to give another part number.

Can anyone suggest how to get around this problem? It is hopefully very simple, but I can't get my head round how to do it!

Many thanks in advance!!

John

View 1 Replies View Related

Data Validation/Mining

Feb 26, 2006

I'm making a student report card. Teachers enter data and then I print them all.

Sometimes data is missed in a field or it's deliberately left empty becasue the data doesn't apply to that student.

I'd like to generate a rpt that shows empty fields. Basically, I'd like a list of student names and the field names that are empty/null so that I can approach teachers and ask them if it was deliberate on not before I print. With 100 or so fields, I can't seem to nut out a query to make it all work.

Any ideas??

View 1 Replies View Related

Data Validation Against Query

Apr 26, 2006

Hi - I have an inventory management database allowing stock to be moved between various subinventories. The user choose a transaction type and then details which goods to move. However at the moment they could enter a Quantity that is greater than that available in that subinventory.

So I have a query that gives me:
Part#
Subinventory
OnHandQty

The data entry form has a control source directly to the Inventory Table. I want to compare a text field [Qty] on a new inventory transaction (the person already having selected Part# / SubInventory from combo boxes) to the On Hand Qty.

I have tried Expression Builder in the Field Validation Property and I have tried some sql code on the AfterUpdate of the text box. I'm just not getting it.

Any help appreciated.

Cheers,
Darren

View 3 Replies View Related

Data Validation Rule Help

Feb 15, 2008

I am an absolute beginner and urgently need help with a validation rule. I need to know how to set a rule to set a minimum and maximum length for a text field record. I want minimum to be 4 and maximum to be 15 (I know I can set a max field size and set to not null but not sure how to make a minimum validation rule.
I am a teacher (not ICT!) having to cover for a sick colleague and students have asked me how to do this and although I am working my way through many of the great learning resources you link to here I have not yet worked out how to do this.
Would really appreciate any help you can give me so I can do my best by the kids.
J

View 4 Replies View Related

Tables :: Validation Rule To Change Field To Alphanumeric Only?

Dec 6, 2013

What would I need to enter into the validation rule to change the field to alphanumeric only?

View 3 Replies View Related

Validation Rules For Data Integrety

Dec 18, 2004

I have a field that looks up the JobType using a LookUp Combobox from another table where these records for JobType will never change.

I want the user to only be able to select from the Combobox for the job type they want and be able to type the beggining of the job type so that the desired job will pop up. Now, i need the field to not be able to accept any other data than what is in the LookUp, so that they cannot enter false values. Duplicates of jobtypes are possible so a primary key cant be used.

Any help guys?
-thanks

View 1 Replies View Related

Modules & VBA :: Form Data Validation?

Jun 12, 2013

I would like to write some code to validate that when a user enters data into a text field, the user must enter 4 digits.

View 3 Replies View Related

Forms :: Validation Of Data In A Form?

Sep 22, 2014

I am trying to validate data held in two controls on a form.

The first control records membership status and is a combobox with 5 values allowed.

1 is 'member'
2 is 'under consideration'
3 is 'left' etc.

The combobox displays the description, the underlying table the number 1-5.

The second control records 'reason for leaving' and again is a combobox with 7 entries just as above.

I need to ensure that if a value is entered into the second control the value of the first control is '1' or 'member'.

Whatever I do I cannot get any code to work.

So, what event should I link to the code attached to the second combobox? On lost focus, before update or what?

What value do I check for in the comboboxes, the text or the number?

How do I set focus back to the first combobox in the event of an error?

View 7 Replies View Related

Modules & VBA :: Data Validation With Comboboxes

Jan 23, 2015

I have 2 combo boxes on a form. The 2nd box is not visible unless the 1st box is set to a specific value (Illness). Once the specific value is set, the 2nd box appears with appropriate data for selection.

Goal #1:
I would like to have the form checked before it is closed to ensure that if the condition in box 1 is "Illness" then the 2nd box must have a value and can not be null.

Goal #2:
I am also having problems with the 2nd combo being visible when form opens or becomes current. The field is set to visible=false normally but needs to be visible when form opens if the conditions mentioned above are meet (true).

Private Sub Form_Unload()
If IsNull(Me.Incident_Classification) Then
MsgBox "Please select a type of Illness"
Me.Incident_Classification.SetFocus

]Code] .....

View 3 Replies View Related

Tables :: Validation Rule Doesn't Recognize Hyphen As Text

Feb 15, 2013

I'm struggling with a validation rule that almost works but not quite.

I want to restrict the values in a feild by characters between 0-9, A-Z, _ and -

Using the following string works for all except the hyphen, which I assume is because it's an operator:

Is Null OR Not Like "*[!((a-z) or (0-9) or (_) or (-))]*"

Is there something I can do to make it recognise the - as text?

View 2 Replies View Related

Tables :: Set Validation Rule For Unit Field In Design View

May 1, 2013

I have two tables in Access 2010:

Tbl1 - Abbreviations: with fields (1) "Abbreviation" and (2) "Definition"
Tbl2 - Piping: with multiple fields one of which is "Unit"

In Design View of Tbl2, I'd like to set the "Validation Rule" for the "Unit" field so that it is restricted to values in field 1 of the Abbreviations Table (i.e. one of the listed abbreviations").

I tried variations of "[Tables]![Abbreviations]![Abbreviation]" in the "Validation Rule" portion of the Design View for Tbl2 (Piping) but, couldn't get this to work.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved