How To Prevent Data From Changing

Mar 3, 2008

I have a form that with a combo box that is populated by a query. The user can select a value from the combo box which then opens a form filtered by the chosen selection. However I have noticed that the identifier field gets changed when the form is closed. I would like to prevent the identifier from being changed will still allowing the user to make a selection. I am open to any suggestions.

View Replies


ADVERTISEMENT

Prevent Saving Bad Data

Oct 29, 2004

My boss wants to add his own job numbers, so I made the JobID field a number field that he can enter (instead of autonumber, which is obviously preferable). So, in order to prevent him from entering a duplicate primary key (JobID), I have the following code in the BeforeUpdate event:

Code: Dim dbRoofing As DAO.DatabaseDim rcdJobs As DAO.RecordsetDim intJobID As IntegerSet dbRoofing = CurrentDbSet rcdJobs = dbRoofing.OpenRecordset("tblJobs")intJobID = Me!JobIDrcdJobs.FindFirst "JobID=" & intJobIDIf rcdJobs.NoMatch = False ThenMsgBox "This job number already exists.", vbOKOnly, "Invalid Job Number"Me.JobID = ""Exit SubEnd If
with the 'Me.JobID = ""' in there to set JobID back to nothing so he can't save a duplicate. However, Access won't let me do this, and when a duplicate is added, all sorts of errors pop up. How do I prevent him from saving a duplicate job number, or more generally, how do I prevent certain data from being saved based on other data?

Thanks

-Jason

View 7 Replies View Related

Trying To Prevent Duplicate Data Inputs

Mar 23, 2005

I have a form that contains 5 fields and want to ensure that duplicate information is not entered. I am aware that when creating the form you can set Duplicate Records to No but each record has an AutoID which I assume means that even if the information is the same it will not register as a duplicate record due to the different AutoID.

There should only ever be 5 records entered per day. One for each region

I have created a Sanity Check that is displayed as a sub form that shows if the relevant information has been entered for a given day in Bookings and Backlog but this doesn't stop the user from putting in the same information twice. i.e. the User starts inputting the information gets called away and then trys to put it in again but doesn't check the sub form.

The Table in which the information is stored is called Bookings and Backlog.

The 5 fields on the form which is called Bookings and backlog are

ID (Autonumber)
Date (Short Date)
Combo26 (Text) (5 Regions:- North, South, East, West, Central)
Bookings (Number)
Backlog (Number)

I have put the following statement in AfterUpdate on the Combo26 field

If Me.Date = DLookup("[Bookings and backlog]![Date]", "[Bookings and backlog]", "[Bookings and backlog]![Date]=[Date]") And Me.Region = DLookup("[Bookings and backlog]![Region]", "[Bookings and backlog]", "[Bookings and backlog]![Region]=[Combo26]") Then
'Define Message Box
MsgBox "The Region you have chosen already has data entered for this day." & vbCrLf & vbCrLf & "Please check your records and amend were neccessary.", vbCritical, "USER INPUT ERROR"
Else
End If

However I'm not to hot with writing VBA and probably got something wrong somewhere as it doesn't seem to do anything and lets the user progress regardless. I have tried amending the above script and asked it to look at just one field but this just seems to give the message regardless of the information selected in the Combo box.

Can someone give me an indication as to what I have done wrong so I can put it right and in a language that is easy to understand so that if I have a similar issue later on I don't need to post another question.

View 3 Replies View Related

Prevent Duplicate Data In Form On A Fly...

Jul 5, 2006

Hi,

I have searched through the whole posts but could not find my query. I have a question related to prevent duplicate data entry in a form field.

I have a Form with 5 fileds on it: SNO, NAME, ROLL NO, CLASS, SECTION.

in the table design i have set the option of NO DUPLICATES on SNO(Autonumber) ROLL NO (text).

I wish to stop a user entering duplicate data in ROLL NO field before he reaches at the last field. What i meant is as soon as a user enters data in ROLL No field, it should check in table if the same data is already there. If the same data is found then it should give a message to prompt user of duplicate data, else it should continue to next field.

I have searched the whole forum but in vain. I am positive that there must be some one who holds the key to this solution.

Regards,

Darno

View 1 Replies View Related

Opinions On Best Way To Prevent Duplicate Data

Dec 1, 2006

Hi all: I currently have a database with a list of clients, and it is to be accessible to others to enter information on clients and to add new ones. However, I want to make it so that the user who wants to add a client can easily search the database for that particular client so that they won't enter a duplicate.

I have created a search function on my form, but then it occurred to me: what if there are two people with the same last name's? At first, I wanted a search operation to display a list of client names, along with their respective ID numbers and possibly a link next to each that would take the user to the corresponding record.

However, I have no idea how to do this, and I'm unsure as to whether or not this is the best way to tackle the problem. Please, someone show me the way!

View 7 Replies View Related

Forms :: How To Prevent Duplicate Data

Aug 11, 2015

I am putting the student names in a form. I want it to alert me that a name is duplicated. But thats not this simple. For example a name is Jennifer Locus but I type jenifer with one . Can access guess that this might be the same person and suggest me to correct the spelling or enter it as a new person?

View 2 Replies View Related

Modules & VBA :: Prevent Duplicate Data Over 2 Fields

Dec 25, 2014

I currently assign multiple 'skills' to departments using a listbox and a combo using the following code

Code:
Private Sub cmdSaveReq_Click()
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset

[Code]....

However as time goes on we may want to add new skills to the depts - ive used dcount to check if the data exists in one field before however how would it be possible to check to see if the data combination exists over deptid and skill

View 3 Replies View Related

Queries :: 2nd Query Prevent Data Entry

Apr 17, 2014

I have a query based on two other queries

If I create a form based on the fields in my query the form will not allow me to edit any fields - no matter what.

All fields are unique however I am stumped as to why I can't edit the data. Even adding in the second query immediately stops data entry even without linking.

View 4 Replies View Related

How To Prevent Duplicating Records When Importing Data

Oct 14, 2011

We are a travel company and I am just setting up a new database with two tables - [Client_Table] & [Enquiry_Table].

Most exisiting clients call in when they want to make a new enquiry so the 'user' can go it to a form which creates a 'new enquiry' for that client.

We also download 'new enquiries' from our website. This data includes info that goes in to the [Client_Table] and [Enquiry_Table]. They download in to a XL spreadsheet. Currently I copy and paste the data (not sure if there's a better way) from the XL speadsheet in to a query. This query creates a new client record & a new enquiry record which are both linked by a primary key [Client_ID].

This all works however the problem I have is that sometimes existing clients enquire through the website. They do fill in a field to say they're an existing client but if I paste them in to the query as explained above it creates a duplicate client record.

The only way around this I can think of is it to take out any exisitng clients from the XL spreadsheet first, search for their Client_ID and then paste these enquiries seperately with their Client_Id's in to different query which only adds a new record to the [Enquiry_Table] and links them to their exisitng record in the [Client_Table].

View 3 Replies View Related

Sub Reports With No Data - How Do I Catch And Prevent Errors In Calculations

Jun 15, 2004

I have come across this problem several times. I have sub reports on a report and calculations are done using the data in the sub report. In many instances the subreport is empty. The calculated fields read #error. (otherwise the report runs well and records with data calculate fine) I would like to hide these errors and associated labels when the subreport is empty. Everything I have tried either does nothing (error still appears in text box - but runs ok otherwise) or I get a runtime error since it is trying to access "nothing" in the sub report.
How can I catch and therefore react on this empty sub report. (or subform too)
Thanks
Lisa

View 13 Replies View Related

Modules & VBA :: Prevent For Duplicate Data (Time / Date)

Jul 26, 2014

I've a Sub form as datasheet view/grid.

See Capture1 & Capture2.

I'd like to prevent for duplicate time/date for same GuideCode. How can i prevent for those during the entry time or save time ? Is it possible ?

Capture1.

Capture2.

1. AUNKZ(GuideCode) is already assigned in other file number(12345) for 03-Aug-14 (as 02-Aug-14 to 04-Aug-14).

2. TOD(GuideCode) is already assigned in same file number(23456) for 10-Aug-14, 12:00 PM (as 10-Aug-14 to 10-Aug-14, 8:00AM to 1:00PM). I'd like to prevent if the file number are same or not same.

View 14 Replies View Related

Prevent Subform From Updating If Main Form Data Is Invalid

Nov 4, 2005

Hi,
Mainform and Subform are linked on field "barcode".

Barcode is the primary key for the table that Mainform is based on.

When user is entering a new record, I have the BeforeUpdate event of Mainform.barcode set to check to see if the barcode already exists in the table, and if so, to give the user some meaningful error message.

Works fine, except that the subform still updates to match the invalid, previously-used barcode. I want the subform to stay blank until the user has entered valid data in MainForm.

How do I accomplish this?

Thanks for any ideas.

View 11 Replies View Related

Tables :: Prevent User Entering A Return When They Paste Data

Feb 26, 2013

I've just come accross a problem where pasted data dissapears from view. It's caused by people being a bit careless and copying the line above (from word or notepad for example), which adds a return and then the data drops out of view.I really want to create a validation rule to make it impossible for returns to be pasted but I'm not sure how.

View 2 Replies View Related

Prevent User From Skipping Records In Continuous Form During Data Entry

Nov 21, 2006

I have a main form with several continuous subforms. Each subform consists of several listbox controls. I would like to require the user to select an item from the listbox before being allowed to move to the next record in the subform, and upon reaching the last record in that continuous subform, to require an entry there in order to move to the first record in the next cont. subform.

As an added bonus, it would be nice, though not necessary, to automatically jump the focus from one record to the next after data is entered. But my basic goal is to avoid skipping records.

Caveat: I cannot use the "required" option in the field to which the control is bound because that field has a default value previously entered using an append query. (The default value basically means "not yet entered" and is not one of the options in the listbox. I am using this because this field is a foreign key in the table, thus it must have a value in order to have a record with which to populate the subform.)

My apologies if this has been asked and answered elsewhere, but I've searched and, while I found a few related threads, they don't quite answer my question. Here they are for reference:

http://www.access-programmers.co.uk/forums/showthread.php?t=38364
http://www.access-programmers.co.uk/forums/showthread.php?t=69047
http://www.access-programmers.co.uk/forums/showthread.php?t=103176

Thanks for any help! Also, if you are going to recommend VB code, could you be specific about how and where I should use it? I'm not afraid of code, but I'm definitely new to it...

View 7 Replies View Related

Forms :: Prevent Entering Data A Second Time Onto Access 2010 Table

Mar 4, 2014

I have a simple data entry form where I can key the "row", "COLUMN", SPACE "a" and space "B" onto an access 2010 table. Is there a way that if I key the same four fields, e.g., A5AB that I get a message back before updating telling me that combination already exists?

I do generate a calculated data field, which in this case would be "a5ab" and which is displayed on report screens. Could the value of this calculated field be stored on the Table and be used to prevent the same value from again be entered on the Table?

View 2 Replies View Related

Tables :: Changing Field Data Type But Keeping Data

Oct 23, 2013

I have a field in a table that is comprised of mostly numerical data but some records are text.

I want to convert this field to numerical only and make a new field to put the textual data in.

However converting the field will delete the textual data. What is the easiest way to convert the field but save the textual data AND append the textual data to the SAME record that they were in originally in the new field?

View 2 Replies View Related

Changing Data In Query Results Changes Data In Source Table

Dec 17, 2012

I have a table and a simple query that pulls results from the table. Nothing too crazy. But, if I were to go in and change some of the data/values in the query results it will change the respective data in the table. I know that this cannot be right. What do I have to do to either prevent the ability to change query results and/or prevent any changes in the query from altering the original data in the table.

View 2 Replies View Related

Changing Data Types

Oct 19, 2005

Is there a way to change the data type for multiple fields at once? Such as 20 text fields to numeric in one step.

Thanks

View 1 Replies View Related

Changing Data Type

Feb 18, 2005

I have inherited a table where the data type is binary in some cases and I want to change these to Numerical. When I do this in design, I get a message which says I can't do that. I have something like 200,000 records.

If I try to export as Text file I get Invalid Argument message coming up. Can anyone help?

View 2 Replies View Related

MDB....underlying Changing Data Source

Dec 1, 2006

Hi!

I have an MDB file that points to a postgres database. What I'm trying to do is to redirect it to another datasource. The database is exactly the same, but I just need to point it to a different location. I tried doing this with linked table manager by refreshing the table and enabling the "always prompt for new location". I was able to point to my new location but what happened was my MDB became readonly, I am unable to edit anything after I changed the datasource.

View 2 Replies View Related

Mysterious Table Data Changing

Nov 10, 2005

I have a table that contains all of our company pricing for services. You can see a screen shot of the table here:

http://www.x-raysband.com/table1.jpg

All of this data is locked and cannot be changed by the user. However, the seasons keep getting mixed up. What I mean by this is that suddenly there will be a record missing from one of the seasons and there is a duplicate record in one of the other seasons. See the spot-shadowed fields here:

http://www.x-raysband.com/table2.jpg

Off season and Spring are now missing entries for CDJ, INC but the records that belong in those places are now showing as duplicate entries in Prime and Regular. Simply put, the season name somehow got changed within the record, but there is nothing in the system that allows a user to do that.

This has been happening ever since I added the pricing feature to the DB and I am completely stumped. Our work DB has the tables stored in a SQL server back end.

If anyone can shed some light on why this might be happening, any help would be appreciated.

View 7 Replies View Related

Changing Data In A Field Using A Form

Dec 14, 2005

I have made attempts at this but none have worked, so I am looking for guidence.

What I creating is a database that I can track students and their community service hours.

I have made several versions but I figured the experts could point me in the right direction.

So far I created two tables:

tblStudents
STUDENT_NAME - Text
HOURS_GIVEN - Long Integer

tblHours
STUDENT_NAME - text Links to tblStudent
DATE_COMPLETED - Date
HOURS_COMPLETED - Long Integer

I created a form "frmStudent" with the following:

a drop box to chose a student name from "tblStudent"
a text box "txtSTUDENT_NAME"
another text box "txtHOURS_GIVEN"
another text box "HOURS_REMAINING"

Then I have a subform that has two text boxes "txtDATE_COMPLETED and "txtHOURS_COMPLETED"

I need a code that will enable me to chose a student from the combo box and then have that students name and hours given automatically enter into the respective text boxes in the main form. Then I would enter the date and hours completed into the respective text boxes of the subform, which in turn would update the fields in "tblHours" at the same time subtracting the new hours from the hours given and displaying the new total hours remaining in the respective in "txtHOURS_REMAINING" of the main form. Can anyone give me any help in coding that? Thanks in advance.

View 2 Replies View Related

Changing Table Data Via Forms

Mar 7, 2006

Hello everyone, and thanks in advance for any help you can provide.

I am currently working on a large project to track, issue out, and re supply an operational stock of various tools and parts we use in our shop on a normal basis. This program is in it's beginning steps at the moment, and already I need some help.

If anyone has any tips on how I can change the raw numerical data in my table, via a textbox and a command button on a form, I would be greatful. I am trying to avoid allowing users to directly modify table data. Although this method is what I am aiming for, I will gladly accept any suggestions. Thanks

AIC Jason Kiebler
OSAN AB ROK

View 4 Replies View Related

Changing Table Data Using Form

Sep 8, 2004

My scenario is that a user enters how many parts of 'Part No.' are going in or out of Inventory. I also would like fields automatically entered on other tables based on the data the user enters. All I need is some understanding of how to code something like this or a pointing in the direction of a resource that can tell me how to code this VBA stuff and the syntax required.
Hopefully you get what I mean.

Thanks.

View 3 Replies View Related

Changing Data From Columns To Rows

Jun 30, 2006

Hi all,

I have a query which runs off a table. I have the following Fields as columns in query: WeekID, A, B, C, D, E

For each week, the letters correlate points given. So for week 1, "A" could have 1 point, "B" could have 3 points, etc.

I want to run a Query that will show A, B, C, D, E as rows like the following:

Letter_Week 1_____Week 2_____Week 3
A_______1_________5___________3___
B_______3_________4___________2___
C_______2_________1___________7___
D_______6_________3___________3___
D_______3_________1___________4___

I can't run a crosstab because it will only crosstab values within all of A, B, etc.

Any idea guys? Thanks in advance, as always.

Caliboi

View 3 Replies View Related

Changing Data-type In Table?

Sep 27, 2011

My database consists of one large table of approx 3.9m rows and about 12 different columns. One of my columns is of a data type "date/time" but i need the format of this column to be "text"

The problem is that when I right click the table/go to design view/ and try to change the data type, I get the error "Microsoft Access can't change the data type. There isn't enough disk space or memory."

Which means i can't take the easy way out. Is there a way I can just create a new identical table and change the data type of my one column? I was thinking there might be something in SQL I could do, or some how in creating an identical table where only the field type has changed. I should note, I looked up this using the access in file, and it appears the ALTER TABLE SQL will not work on my machine.

the dataset was created from a txt file which as been lost to the ether, and I can't import the database into excel using a macro I didn't write unless the format of my column is text.

View 3 Replies View Related







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