473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checking That A Record Was Not previously Entered

Sue
As soon as a character is entered in the first field of a new record, the number
of records shown in the navigation buttons increases by 1 and the new record
button becomes enabled. In the BeforeUpdate event of the first field, I check to
see if that value has been previously entered. If it has, I do a Cancel = True
and a Me.Undo. The number of records does not change and the new record button
is still enabled although clicking it does nothing. This is confusing! The
indicated number of records is wrong and you can not go to a new record. Is
there another way of checking that a record was not previously entered than what
I am doing in the BeforeUpdate event?

Thanks!

Sue
Nov 12 '05 #1
5 3065
TC
I don't have Access here to check, but I believe that the cancel & me.undo
would just undo the value entered in that field. I don't think it will undo
the creation of an unsaved new record. So you are still positioned on a new
record, no?

Do you really want to automatically >discard< the unsaved (blank) new
record, when the value entered in that field is already on file? That's a
bit non-standard, IMO. Normally you would issue a message, cancel the
beforeupdate, but >not< Undo. Then the user can amend the value & try again,
or press Esc a few times to discard the unsaved new record.

HTH,
TC
"Sue" <sp*****@eartkl ink.net> wrote in message
news:S9******** *********@newsr ead1.news.atl.e arthlink.net...
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the BeforeUpdate event of the first field, I check to see if that value has been previously entered. If it has, I do a Cancel = True and a Me.Undo. The number of records does not change and the new record button is still enabled although clicking it does nothing. This is confusing! The
indicated number of records is wrong and you can not go to a new record. Is there another way of checking that a record was not previously entered than what I am doing in the BeforeUpdate event?

Thanks!

Sue

Nov 12 '05 #2
Sue
TC,

Thanks for responding!

If you don't Undo and the user closes the form without pressing ESC a few times
then a blank record is saved.

Sue
"TC" <a@b.c.d> wrote in message news:1068952429 .901715@teuthos ...
I don't have Access here to check, but I believe that the cancel & me.undo
would just undo the value entered in that field. I don't think it will undo
the creation of an unsaved new record. So you are still positioned on a new
record, no?

Do you really want to automatically >discard< the unsaved (blank) new
record, when the value entered in that field is already on file? That's a
bit non-standard, IMO. Normally you would issue a message, cancel the
beforeupdate, but >not< Undo. Then the user can amend the value & try again,
or press Esc a few times to discard the unsaved new record.

HTH,
TC
"Sue" <sp*****@eartkl ink.net> wrote in message
news:S9******** *********@newsr ead1.news.atl.e arthlink.net...
As soon as a character is entered in the first field of a new record, the

number
of records shown in the navigation buttons increases by 1 and the new

record
button becomes enabled. In the BeforeUpdate event of the first field, I

check to
see if that value has been previously entered. If it has, I do a Cancel =

True
and a Me.Undo. The number of records does not change and the new record

button
is still enabled although clicking it does nothing. This is confusing! The
indicated number of records is wrong and you can not go to a new record.

Is
there another way of checking that a record was not previously entered

than what
I am doing in the BeforeUpdate event?

Thanks!

Sue


Nov 12 '05 #3
TC
Sue, there's no way you can save an all-blank record. It simply does not
happen. I think that what you are seeing, is a well-known Access bug. If you
close a form by clicking the close button at the top right corner, Access
tres to save the pending new or edited record - as it should do. But if it
can not< save that record for any reason - eg. a missing mandatory field - it discards the record >silently<, without a visible message of any kind. So
I think that what you are seeing is, the unsaved new record being discarded
silently - not saved.

Yes? No?

HTH,
TC
"Sue" <sp*****@eartkl ink.net> wrote in message
news:hj******** *********@newsr ead1.news.atl.e arthlink.net... TC,

Thanks for responding!

If you don't Undo and the user closes the form without pressing ESC a few times then a blank record is saved.

Sue
"TC" <a@b.c.d> wrote in message news:1068952429 .901715@teuthos ...
I don't have Access here to check, but I believe that the cancel & me.undo would just undo the value entered in that field. I don't think it will undo the creation of an unsaved new record. So you are still positioned on a new record, no?

Do you really want to automatically >discard< the unsaved (blank) new
record, when the value entered in that field is already on file? That's a bit non-standard, IMO. Normally you would issue a message, cancel the
beforeupdate, but >not< Undo. Then the user can amend the value & try again, or press Esc a few times to discard the unsaved new record.

HTH,
TC
"Sue" <sp*****@eartkl ink.net> wrote in message
news:S9******** *********@newsr ead1.news.atl.e arthlink.net...
As soon as a character is entered in the first field of a new record, the
number
of records shown in the navigation buttons increases by 1 and the new

record
button becomes enabled. In the BeforeUpdate event of the first field,
I check to
see if that value has been previously entered. If it has, I do a
Cancel = True
and a Me.Undo. The number of records does not change and the new
record button
is still enabled although clicking it does nothing. This is confusing!
The indicated number of records is wrong and you can not go to a new

record. Is
there another way of checking that a record was not previously entered

than what
I am doing in the BeforeUpdate event?

Thanks!

Sue



Nov 12 '05 #4
Me.Requery should correct the count of records.

HTH
- Turtle

"Sue" <sp*****@eartkl ink.net> wrote in message
news:S9******** *********@newsr ead1.news.atl.e arthlink.net...
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the BeforeUpdate event of the first field, I check to see if that value has been previously entered. If it has, I do a Cancel = True and a Me.Undo. The number of records does not change and the new record button is still enabled although clicking it does nothing. This is confusing! The
indicated number of records is wrong and you can not go to a new record. Is there another way of checking that a record was not previously entered than what I am doing in the BeforeUpdate event?

Thanks!

Sue

Nov 12 '05 #5
Even after the Me.Undo, you are still on the (blank) NewRec. You need to
make one of the existing Records the CurrentRecord of your Form.

Try moving to the last Record with:

DoCmd.GoToRecor d , , acLast

after you set Cancel to True.

(tested OK in A2K)

--
HTH
Van T. Dinh
MVP (Access)

"Sue" <sp*****@eartkl ink.net> wrote in message
news:S9******** *********@newsr ead1.news.atl.e arthlink.net...
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the BeforeUpdate event of the first field, I check to see if that value has been previously entered. If it has, I do a Cancel = True and a Me.Undo. The number of records does not change and the new record button is still enabled although clicking it does nothing. This is confusing! The
indicated number of records is wrong and you can not go to a new record. Is there another way of checking that a record was not previously entered than what I am doing in the BeforeUpdate event?

Thanks!

Sue

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1261
by: Keith | last post by:
I have a simple form where a user enters their email address, which then passed them to a 2nd page where the email address entered is used to filter a recordset. How can I set up an IF statement so it checkes every record in the recordset, and if the email address entered does not match any record redirect to another page? Thanks
2
2833
by: R Bolling | last post by:
I am using a routine to check to see if a phone number (PK) has alread been entered, and takes the user to that record if it is found -- as follows: Private Sub Contact_telephone___BeforeUpdate(Cancel As Integer) Dim rs As DAO.Recordset Dim iAns As Integer Set rs = Me.RecordsetClone rs.FindFirst " = '" & Me! & "'" If Not rs.NoMatch Then
1
1735
by: Richard Hollenbeck | last post by:
I'm getting errors. Access is telling me that it can't add a record. I have a table of college courses and a linked table of groups of activities in that course as a linked table (one course to many groups of activities). "Groups" include things like Participation, Exams, Essays, Etc., Etc., Etc. I have a main form showing the course information (courseID, courseDescription, courseStartDate courseEndDate, etc.) and a sub-form showing the...
15
4657
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 field to start. If I edit that field and then click on the new record button in the navigation buttons, the form goes to a new record and each field has the default value of the previous record. If I put the focus in any field to start, edit that...
6
1867
by: John | last post by:
Hi We have a staff database and need to make sure that the same staff is not entered twice. Is there a way for Access to flag if combination of forename and surname fields is already in the system when adding a new record? Preferably straight after entering forename & surname so user does not waste time entering the rest of the info. Thanks
6
2731
by: Joey Lee | last post by:
Hi, I was wondering which is the best way of checking if a record exist in the database before inserting. There are quite a few ways I have seen. Here are some... 1> Insert and hit a primary key violation and then handle it
16
11786
by: MartinR | last post by:
I would like to know the code that i should use to delete a record without the message box saying "You are about to delete a record, are you sure..." poping up. At the moment i am using the code: DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70 Any ideas to help me
7
5887
by: brewer95 | last post by:
I use a form to enter data into a table. The user then has the opportunity to recall the data in the form based on a search to review and update the info. For example, on my menu there is a combo box where the name is selected. Once the name is selected my code recalls the form with the previously entered data. The problem I have now is that when the same name is used for a new trip (same person, new trip) my form displays the data that...
482
27893
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. what i am trying to display previously entered multiple fields. I am able to get my serial fields to display correctly, but i can not display my parts fields correctly. Currently this is what it does serial information 1 parts 1
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.