UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Input Box    
 
   
dean411
post Aug 13 2006, 02:51 PM
Post #1

UtterAccess Addict
Posts: 131



I have a form that makes an input box appear when a user clicks a particular object. I need some code that will allow the user the click cancel and the input box will dissappear (ie - not run an error) and will not let the user click OK without entering in a value.
NB: some of the input boxes require text while others require numbers and/or dates.
Go to the top of the page
 
+
ScottGem
post Aug 13 2006, 04:21 PM
Post #2

UtterAccess VIP / UA Clown
Posts: 25,085
From: LI, NY



You can't do this with an input box. Use a Popup form instead. Then you can add a Cancel button.
Go to the top of the page
 
+
dean411
post Aug 14 2006, 06:50 PM
Post #3

UtterAccess Addict
Posts: 131



Is there some code that will perform a loop for the info instead? For example...

Do While IsNull(myVariable)
'A loop to keep prompting the user for myVariable until something is entered
Loop
Go to the top of the page
 
+
ScottGem
post Aug 15 2006, 07:36 AM
Post #4

UtterAccess VIP / UA Clown
Posts: 25,085
From: LI, NY



This is confusing. You want to allow the user to cancel the Input, but then you want to keep prompting them if the value is Null? That's contradictory.
Go to the top of the page
 
+
dean411
post Aug 15 2006, 02:23 PM
Post #5

UtterAccess Addict
Posts: 131



If the user clicks Cancel, I would like it to ignore the fact that the InputBox was commanded to appear. (Any statement will do). But I don't want the user to be able to click OK without entering a value.

If there is no way to do this, then I'd just like a statement that will not allow the user to do anything unless something is entered in that InputBox.
Go to the top of the page
 
+
ScottGem
post Aug 15 2006, 02:54 PM
Post #6

UtterAccess VIP / UA Clown
Posts: 25,085
From: LI, NY



The problem here is that there is no way to delineate between whether the user just hit Enter without filling in the box or pressed the Cancel key. Both actions return a zero length string. The only way to do that is to set a default value, since pressing Cancel returns a zero length string.

Using a form gives you much greater flexibility.

However, you can easily check if nothing was entered.
CODE
x=""
Do While Len(x) = 0
     x=InputBox("prompt")
Loop

As long as nothing is entered, the message box will continue to appear.
Go to the top of the page
 
+
dean411
post Aug 15 2006, 03:40 PM
Post #7

UtterAccess Addict
Posts: 131



Thanks, that works.

Is there anything that will work for numbers and date?
[I've already tried using val(myVariable)]
Go to the top of the page
 
+
ScottGem
post Aug 15 2006, 05:43 PM
Post #8

UtterAccess VIP / UA Clown
Posts: 25,085
From: LI, NY



Anything input into an Input box is text. You would have to convert it AFTER its input.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 09:20 AM