Forms :: Using Data From Another Table As Validation Criteria For A Field In Form?

Mar 24, 2015

I've two tables, QA (Quality Assurance) and Instruments. I'm using form to add data to QA.

There's a field in QA, named InstrumentUsed. The criteria is that InstrmentUsed should only accept value when 'status' field in Instruments table shows 'working'. If status is 'faulty' or 'need repair', it should pop up the related error message and cursor stays on the same field.

I've not starting learning VBA yet, so I'm trying to make use of Macro's.

How to use data from another table as a validation criteria for a field in form?

Pops up a MessageBox and stays on the same field, on the form, unless error is resolved?

View Replies


ADVERTISEMENT

Forms :: Text Box Data Validation Against A Field In Another Table?

Jun 15, 2013

I am working on a form that registers new training attendees. One of the fields in my form asks for dealer number.

I have a separate table where all the dealer information is stored. One of the fields is a Customer Number field

I want to ensure that entries in the Dealer Number textbox on my New Registration form matches a valid Customer Number in the Dealer Database Table

I would like this verification to occur either upon a Click event with a button or on an After Update event.

View 6 Replies View Related

Queries :: Data Validation Of A Field In Existing Table

Aug 13, 2015

I'm trying to write a query that will validate a field in an existing table. I want the query to show where any of the 412,000 records fail this strict validation:

AAnnnnnnA

...where A is any letter A-Z and n is a digit 0-9

Clearly I can use the LEN function to check for invalid lengths (anything <>9), but I'm looking for a simple neat expression I can use that will check the format. Does an existing function already exist before I resort to writing my own function in VBA (again)?

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

Forms :: Dynamic Data Validation For Fields On A Form?

Jun 7, 2013

I'm a BA so i'm converting my excel issues list into a database with a front end where i can create new issue records this uses a form that sits on top of the issues_table.

Howver, i have created a table called Projects and a table called Test_Plans

Each issue is logged against a project and a test plan. Lets say ProjectA has TestPlan1 and ProjectB has Testplan2.

On my issues form, i can select ProjectA in the project field.

In the Testplan field i can select EITHER TestPlan1 or Testplan2

Testplan1 is the only valid entry.

How do i

a) Once I have selected ProjectA in the Project field only display Testplan1 in the Testplan field?

or

b) If the user tries to enter testplan2 for it to error?

I've tried creating a query and linking the controlsource field to it but it doesn't like that!

View 10 Replies View Related

Forms :: Looking Up Data From A Table To Set Form Field Default

Feb 11, 2015

I have a basic invoicing setup, with a Form (Invoices) and subform (InvoiceDetails).When in the subform, i have a combo box to choose a Product Code (saved in table as PCode).I want now to auto fill in the NettPrice and (Product Description) PDesc fields in the subform row - by looking these up in the Products Table and entering the data into the relevant fields on the Subform. This lookup will be based on PCode.

I tried all sorts of methods and the one i favour, if i could get it to work, is setting up a Function then calling this function from the Default Value property of each field involved.So, for the Product Description field (PDesc), i created a Function as follows:

Function GetDesc () As String
GetDesc = DLookup ("[PDesc]", "[Products]", "[PCode] = " & Forms!InvoiceDetails!PCode)
End Function

Then i try to call by entering =GetDesc () into the Default Value property for the PDesc field.I seem to have a syntax problem with my function code.I know some of my values like NettPrice need not be fields on my Invoice Details table, but the prices change and I also need to be able to overwrite prices etc when typing invoice.

View 14 Replies View Related

Queries :: Using Field Data On Form As Criteria In Report

Jul 12, 2013

I have a form. On the form I have a button to run a report.The query associated with the report selects all records within a unit (field name (Unit) is used as the selection criteria).Rather than type in the unit name when the report is run, I want to select the unit that is currently shown on the form.

View 4 Replies View Related

Update Field On Separate Table If Result From Form Equals Certain Criteria

Mar 17, 2012

I have a form, which i use to book in products received. What i want to do is if the quantity received is equal to what was ordered then i'd like to update a yes/no field (Order Complete) on a separate table to true.

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

Table Field Validation

Apr 20, 2005

hi,

instead of providing validation at the client side or in the server script....
cant i provide validation in the tables fields...
I have a field named YearID, datatype text..

But I want to allow only text like this ==>
e.g. 'F-00'
'F-01'

Do I have to put any format property...
please do help...
thank u.

View 1 Replies View Related

Validation In Table Field

Aug 12, 2005

Table field (primary key) data type:Number
How can I validate / symbol as in 05/01 representing year and 1st record, etc.
Many thanks in anticipation.

View 2 Replies View Related

Forms :: Combo Box Query - Form That Searches A Table To Show Certain Criteria

Jul 21, 2014

I have created a form that searches a table to show certain criteria. I am having trouble with a part where the table uses a checkbox and I am trying to use a combo box on the search form to return the results based on is it checked? Yes/No or both. When I test it I keep getting Runtime error 3075 missing operator.

The sql I am using is below and when I try and see where it is going wrong it highlights the line.

Code : Me.Filter = strWhere

Code:
Private Sub cmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "#dd/mm/yyyy#"

[Code] .....

View 1 Replies View Related

Validation Rule Based On Data In Table

Mar 8, 2005

Hi,

Does anyone know if its possible to base a validation rule on the data that is already in the field in a table?

e.g. there are 10 records in a table each with an ID number starting at 1 and going up to 10. When new record added i need a validation rule that will prompt the user to enter a number greater than the previous number entered for the ID.

so they will not be able to enter 1 - 10.

hope thats clear

cheers.

View 1 Replies View Related

Validation Rule By Relating Data With Table

Dec 18, 2013

I have tried several ways to validate my data with existing table I've developed.

Actually, I want the access to validate the data (Cellphone number) I've entered in the textbox by looking it in the existing table. So, if the data is there in the table, the message will pop up such as.. "Please continue". But if not, the message should be "this number was not registered yet.." and the textbox will be empty and ready for the new number...

View 14 Replies View Related

Validation Rule On Field In A Table

Apr 10, 2007

Hi

I have a form which people fill in (made up of fields from Table1) to record when sick days.

On the form, they have to enter the "week commencing" (which is set at Medium Date format); then they have to enter in a first day (which is set at Short Date format).

The First Day should be no more than 7 days from the date that they enter in the Week commencing field on the form.

I want an error message to pop up if they do this, for example:

Week commencing: 1st April 2007
First Day: 10th April 2007

(because the 10th April 2007 is more than 7 days from the 1st April). But it would be ok if they did this:

Week commencing: 1st April 2007
First Day: 8th April 2007

Help???

thanks!

Maria

View 9 Replies View Related

Validation Rule In Table For A Field

Mar 5, 2012

This is pretty simple but I need to place a validation rule in my table for a field so that users can only enter data that starts with APB. What would the rule be?

View 1 Replies View Related

Forms :: Data Validation On Summed Column

Mar 9, 2014

I have done some basic data validation on a form, but I cannot seem to apply data validation to my subtotalled column called SUM FTE.

For the field properties on the Data tab I have the following:

Control Source: =SUM([FTE])
Validation Rule: >1
Validation Text: Total FTE is >1

My test:
Employee A - .50 FTE
Employee A - .60 FTE

SUM: 1.10
Data Validation should indicate SUM FTE >1, but no validation is being reflected on form.

View 2 Replies View Related

Forms :: Data Validation After Record Input

Dec 17, 2014

When I learnt to use vba in excel (to basic level) I was always advised in a userform to validate data at end of record input i.e. when pressing enter and next. Is this true also with access or should i be putting validation rules at the afterupdate stage of a particular control?

View 1 Replies View Related

Forms :: Create Data Entry Form To Input Data For Field

Mar 5, 2015

I an trying to create a data entry form (IndividualsEntryFm) to input data for fields such as (First Name),(Birthdate) etc., these to be saved to the (IndividualsTbl)

I also have another table (NamesTbl) which has family names etc. The two tables are linked by a (MainID) field. I want a combo box on the individualsEntryFm so that I can select the family name. Then I wish the empty fields for the IndividualsTbl to be available to enter data.When I press the save button I then want this data saved, together with the MainID from the combo box to the IndividualsTbl.

I have set the IndividualsTbl with a (PersonID) field as an auto number each individual therefore has a unique PersonID but may well share the MainID. I'm trying to link many people to the same address.

View 1 Replies View Related

Using Table Data Query For Entry Validation Rule

Aug 15, 2007

I'm new to access so I thought this would be easier than it is. I have a list of cities in a simple table . I want use this list (or a query of it) to create a validation rule for a field in a second table "City". How, either with VBA or some other method do I use the Cities database to validate entry. These tables are both in the same project.

Any help is appreciated.

View 2 Replies View Related

Table Validation Rule - Field Accepts Only A-Z

Feb 9, 2006

I am wanting a text field in a table to accept only chars A - Z

In my validation rule I use

Like "a" Or "b" Or "c" Or "d" Or "e" Or "f" Or "g" Or "h" Or "i" Or "j" Or "k" Or "l" Or "m" Or "n" Or "o" Or "p" Or "q" Or "r" Or "s" Or "t" Or "u" Or "v" Or "w" Or "x" Or "y" Or "z"

Which works :D

Then validation text I use

Enter Alphabetical Letters only

Also works :D

Is there any short way to write Like A.....thorugh to Z without the long statement?

View 2 Replies View Related

Forms :: Copy Value From Field In Subform To Field In Main Form During Data Entry

Jul 18, 2013

How can I get the value from a field in one table (in the sub form) to copy/insert into a field in another table (in the main form) when adding a new record?The main form and sub form are linked using parent/child linking, and the sub form is in a tab.I have table A (Visit Dates) in the main form which is used to record the date of a visit to a church. Table B (Quarters and Peals) is used to record an event that took place at that church during that visit. Note that not all visits in table A require a record to be created in table B - but half or more do.

In tables A and B I have a field called "QuarterOrPealID" and these are both primary keys, though the field in table B is set to 'no duplicates' and in table A it's set to 'duplicates allowed', as table A has its own auto number/pk. They are both linked in the relationships.

So, when I add a new record to table A using the main form, I might then need to click on the tab in the sub form to create a new record in table B, which has to be linked to the same record in table A. When the "QuarterOrPealID" auto number/pk is generated in the sub form (table B), I need that value to update to the "QuarterOrPealID" field of the main form (table A), so that when I'm viewing these records the form pulls all the information nicely together.

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

Require Field Entry To Be One Of Entries In A Table? Validation?)

Oct 29, 2004

I am using Access 2002 database with ASP.NET(VB). I usually try to get something working in the access 2002 GUI 1st and I am having trouble with creating the code to require that a field entry be forced to be another exisiting entry in another table. For Example:

UNIT_TABLE has fields UNIT_ID(key), and UNIT_NAME having values of:
1 Tigers
2 Bears
3 Sparrows

BATTLES_TABLE has fields BATTLES_ID(key), ATTACKER_MAIN, and DEFENDER_MAIN


I want the ATTACKER_MAIN and DEFENDER_MAIN choices to ONLY be members from UNIT_TABLE.UNIT_NAME

I set up a combobox and lookup in BATTLES_TABLE as follows:
SELECT UNIT_TABLE.UNIT_NAME FROM UNIT_TABLE ORDER BY UNIT_TABLE.UNIT_NAME;

this OFFERS the CHOICE of any of the 3 clans (ie Tigers, Bears, Sparrows)

but I cannot not FORCE the USE of these....because the end user can option to enter in anything else.(which is not wanted).

How do I add SQL to the LOOKUP such that... the user can ONLY choose to enter text that EXACTLY matches an Already existing entry in the UNIT_NAME field?

I tried to enter a validation rule:
[ATTACKER_MAIN] In ([UNIT_TABLE.UNIT_NAME])

I get an error that the field 'UNIT_TABLE.UNIT_NAME' does not exist.

Thanks for any help with this validation problem.
HKP_MACK

View 3 Replies View Related

Forms :: Validation Rule - 1 Field To Multiple Fields

Aug 12, 2013

I am trying to create a validation rule whereby If a box is checked it makes sure that before saving and moving to the next form several, though not all fields are valid.

Ive tried many variations of:

([x] Is Not Null) OR ([Y] is Null) And ([x] Is Not Null) OR ([Y] is Null] etc etc for the fields I need covered.

Either the rule doesnt work at all or else all data input is invalid!

View 9 Replies View Related

Data Entry Validation Rule In Form

Dec 7, 2012

What I have:
Table named: clients table
Form named: clients data form

The form has the client information. The client sends me a document. I review the document. If the document has the correct info needed, then I have a field named "Incomplete" that is a Yes/No field in the clients table.If the field is clicked, then I want the next date field to appear and then I can fill in the date that it was sent back to them.If the field "incomplete" field is not checked, then I don't want that date field to appear nor do I want to fill it out.

View 3 Replies View Related







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