Hello All,
I've created a report that lists un-filled orders by age (in days). When the user clicks on the report it will ask them to input the number of days. (If the user wanted to see all un-filled orders over the last 30 days, they would input 30) However, If the user fails to enter a value, I get run-time error number 3071. My question is is there a way to FORCE the user to enter a value in order to prevent the run-time error?
5 2987
if they are entering the value into a form you could set an on exit command (from the textbox) in VB such as
If IsNull(Me!txtBoxInput) Then
msgbox "please enter a value"
docmd.cancelevent '- to set focus on the textbox again
else
exit sub
Hello All,
I've created a report that lists un-filled orders by age (in days). When the user clicks on the report it will ask them to input the number of days. (If the user wanted to see all un-filled orders over the last 30 days, they would input 30) However, If the user fails to enter a value, I get run-time error number 3071. My question is is there a way to FORCE the user to enter a value in order to prevent the run-time error?
- Reports do not acknowledge the Click() Event.
- To force a User to enter a legitimate value for the Number of Days between 1 and 30, and to also allow him/her the option of selecting Cancel or OK with no value entered, try:
- Dim strNumOfDays As String, blnAcceptableValue As Boolean
-
Dim intNumberOfDays As Integer
-
-
Do
-
strNumOfDays = InputBox$("Enter some value", "Enter Something or Other")
-
If strNumOfDays = "" Then Exit Sub
-
If IsNumeric(strNumOfDays) And Val(strNumOfDays) > 0 And Val(strNumOfDays) <= 30 Then
-
blnAcceptableValue = True
-
intNumberOfDays = Val(strNumOfDays)
-
Else
-
blnAcceptableValue = False
-
End If
-
Loop Until blnAcceptableValue
-
-
'Use intNumberOfDays for further processing
- Reports do not acknowledge the Click() Event.
- To force a User to enter a legitimate value for the Number of Days between 1 and 30, and to also allow him/her the option of selecting Cancel or OK with no value entered, try:
- Dim strNumOfDays As String, blnAcceptableValue As Boolean
-
Dim intNumberOfDays As Integer
-
-
Do
-
strNumOfDays = InputBox$("Enter some value", "Enter Something or Other")
-
If strNumOfDays = "" Then Exit Sub
-
If IsNumeric(strNumOfDays) And Val(strNumOfDays) > 0 And Val(strNumOfDays) <= 30 Then
-
blnAcceptableValue = True
-
intNumberOfDays = Val(strNumOfDays)
-
Else
-
blnAcceptableValue = False
-
End If
-
Loop Until blnAcceptableValue
-
-
'Use intNumberOfDays for further processing
Not sure where to put the code.....I am running a query to retrieve the data. In the date field I have this in the criteria line
>=DateAdd("d",-[Enter Age Of Appeal In Days],Date())
this forces the user to input a number ANY NUMBER.
Not sure where to put the code.....I am running a query to retrieve the data. In the date field I have this in the criteria line
>=DateAdd("d",-[Enter Age Of Appeal In Days],Date())
this forces the user to input a number ANY NUMBER.
Sorry, misunderstood, but I'll have another look at it later.
Change this line of code ...
>=DateAdd("d",-[Enter Age Of Appeal In Days],Date())
to
>=DateAdd("d",-nz([Enter Age Of Appeal In Days],0),Date())
This will default the number of days to 0 if the user doesn't enter any number. No records will be returned but no error will show.
You can change to 0 to any number (e.g.) 30 if you wish to have a default setting.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: JSjones |
last post by:
Hi all,
I'm new to these boards and my javascript experience is fairly limited
and basic so please bear with me. Anyway, on to the question and some
background. I'm developing using ColdFusion...
|
by: nsj |
last post by:
I am working with a web applicaction that accesses a SQL Server database. I
need the value of the 'id' column of the last inserted row in the table
'PERSON'. The SQL statement for that purpose is:...
|
by: Faraz |
last post by:
Hi,
I am working with DOM and I need to do the following:
<sequence>
<element name="input1" type="string"/>
<element name="input2" type="string"/>
<element name="input3" type="string"/>...
|
by: CW |
last post by:
I have written a chat console using DHTML/ASPX. One of the hidden frame
continuously refreshes and writes any new messages to a conversation
transcript frame. My problem is that I need to keep...
|
by: gimme_this_gimme_that |
last post by:
I'd like to create my own version of google suggest GS.
If you haven't seen GS check it out at :
http://www.google.com/webhp?complete=1&hl=en
I've reviewed several AJAX write-ups on the...
|
by: Captain Dondo |
last post by:
First of all, thanks for the serialize pointer in an earlier thread.
That looks like it's the ticket.
Now, I have a style/php question. (I am a C hacker by background, and
thus everything is a...
|
by: Frank Swarbrick |
last post by:
A few weeks ago I had posed a question about how one my create a cursor for
a query where the predicate condition is dynamic. Meaning that the query
might want to have one of several possible...
|
by: Dave Rado |
last post by:
Hi
I have been the following code by Freefind to use on my search page:
<form action="http://search.freefind.com/find.html" method="get"
accept-charset="utf-8" target="_self">
<input...
|
by: printline |
last post by:
Hello All
I'm quite new to xml vs. PHP, so i hope someone can help with an issue i have been struggeling with.
I have an html form, that when submitted, it should create an xml file, and save...
|
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
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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,...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |