Link to home
Start Free TrialLog in
Avatar of bill201
bill201

asked on

How can one force to add a value in a inputbox on microsoft access 2013

hi

i have a form in microsoft access that when i press on a button it's opening an iputbox that ask "what is the value ". and i want to force the user to put the value 1 or 2, and if he don't enter it this will show up an msgbox that he must to put a value between 1-2, and when he will press ok  the inpubx will show up again like an endless loop, and the user can stop it only when he press on the cancel on the inputbox button


dim a as long
a = clng(inpubox("press a value between 1-2")
if not a>0 or not a <3 then
msgbox "you must ot enter a value between 1-2
inputbox again

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bill201
bill201

ASKER

thanks a lot