473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Custom Error Message

Again, this is something that I have never done. For my form I have
set the date as the primary key for my record.

I want to create an error message that will pop up and notify the user
that a record for that date has already been created and direct them
to the record that they tried to create a record for.

Example: If somebody tries to add a record with the date of 8/4/07 and
that record exists I want a message box to pop up stating "You tried
to create a duplicate record, would you like to go to that record
now?" with a button for yes / no.

Can this even be done?

All help is greatly appreciated

Sep 12 '07 #1
1 1362
On Wed, 12 Sep 2007 13:14:08 -0000, lucky33 <ki*******@bellsouth.net>
wrote:

Of course it can. In the date control's AfterUpdate event you can run
some code to test if this date already exists:
if Not IsNull(DLookup("SomeDateField", "SomeTable", "SomeDateField=#"
& Me.SomeDateFieldControl & "#")) Then
Msgbox "Aarrrcccchhhhh, we already have that date!", vbCritical
end if

Note that this code works just as well with linked tables in a split
database (see my previous answer) as with "real" tables.

-Tom.

>Again, this is something that I have never done. For my form I have
set the date as the primary key for my record.

I want to create an error message that will pop up and notify the user
that a record for that date has already been created and direct them
to the record that they tried to create a record for.

Example: If somebody tries to add a record with the date of 8/4/07 and
that record exists I want a message box to pop up stating "You tried
to create a duplicate record, would you like to go to that record
now?" with a button for yes / no.

Can this even be done?

All help is greatly appreciated
Sep 12 '07 #2

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

Similar topics

6
by: Nick Horrocks | last post by:
I have set up a custom error page for 404 errors. However the HTTP status code returned is 302 followed by 200, this causes search engines not to remove old pages from their index. How can I...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.