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!
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?
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?
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.
I have a form that requires people to enter a number of values. The sum of these values cannot exceed 100. The values are stored in a table for later use. I also want to catch the error here with a message.
I want to include a validation on a form. I have an auto number field called ID and a field called Nature Of Incident. I only want to have the auto number generated if the Nature of Incident is NotNull.
I have little bit problem in access here, if i want to create two textbox... first textbox for time and second textbox for unit. When I type (time) in first textbox, second textbox will appear automatically the unit number...
Example
1textbox-----------2textbox
1<time<=60 ------- 1 unit 60<time<=120 ------ 2 unit 120 < time <= 180 ------- 3 unit
I have a tabbed form built in Access 2007. It's a series of about 32 different questions, with some being fill-in, some drop down boxes to select from, some radio buttons to choose a rating from 1 to 5. The reason I used a tabbed form was just to keep things consolidated on one screen where no scrolling was involved. All of the entries on each of these tabs are deposited into the same single table. I have 7 tabs, and all of the fields on the 7 tabs compose a single record in the table.
I have the actual tabs hidden, and instead use a button to switch to the next tab (Continue button at the bottom) once all the fields on that tab have been completed. I have all of the necessary fields set to be required, but Access does not validate the entries until the very end of the survey when they click a 'submit' button that actually saves the responses and returns to the opening splash page to start the survey again.
What I want to happen is for the fields on the current tab to be validated before it lets the user move to the next tab with the continue button. If they click continue and have left any fields blank they should get a message that all required fields must be completed or something similar to that.
I have found a thread here entitled "Form Validation before Moving to another Tab" which sounds similar to what I'm doing, but using the button method to navigate to the next tab, there is no BeforeUpdated event to assign that code to.
Is there a way to add a validation rule in an access form on an unbound text box. This box is currently doing a calculation of others. If the figure is not between 0 And 0.3125 then I do not want the user to be able to move on. For some reason if I enter "Between 0 And 0.3125" in the validation rule it doesn't seem to do anything. I can only assume its because its an unbound text box. Data attached please see Frm_Input and text box total standard hours.
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?
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?
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.
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.
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!
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.
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!
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.
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.
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
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.
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
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.