Hi again byters. I developed an access 2003 database which contains various different computer, servers, printer etc specifications. (thanks for all the help) The system will be implemented using a touchscreen. The user/ customer will be able to view the different models but will have no previlegies for updating.I have created an invisible small image on the screen that only I can locate and when i touch an hold this for 3 seconds i will have admin access and be able to go to my own personalised forms/queries. The question i have is how to tell this timing information to the click event. Any pointers or help would be appreciated greatly.
Click and hold (need Info)
Collapse
X
-
Tags: None
-
Hi, there.
Assuming touchscreen causes mouse events, you should something like:- In thecontrol_Mous eDown event handler set a global variable to True and run form timer
- In thecontrol_Mous eUp event handler reset the global variable to False
- In Form_Timer event handler check the global variable value and if True, then grant admin access.
Regards,
Fish -
Thanks for the help. I still learning the basic syntax of vb for access. Ive got the concept in my head i just lack the experience an knowhow for example I wish to initialise the timer on mousedown event and stop it on mouse up event.Do we use the TimeInterval property?I know this property is measured in milliseconds Or alternatively if the timer on the mousedown event is > 3000 . (3sec)OpenForm/query screen. Below is what i wish to do. My apologies if it is a bit ambiguous Any suggestions
Abstract code for Mousedown event of image
Code:Private Sub Image30_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'starttimer dim timervalue timervalue='time mouse is pressed and held down if timervalue>3000 'openform etc End Sub
Comment
-
Hi, there.
- Form.TimerInter val property is used to initialize timer. When value is set timer begins to tick. As soon as predefined time will elapse Form_Timer event will be fired.
- You code should be in 3 event handlers (see my previous post).
- Anyway no mouse/touchscreen event will be fired on invisible control.
- Do you really think that is the safest way to grant admin access to user? Or you've seen that in some movie? ;)
Kind regards,
FishComment
-
Thanks again fish lol. Nice to see you have a sense of humour lol. No i was a bit inarticulate previously. The database is set up for customers to browse through a range of products classified by manufacture.
The idea behind the previous posts is that say for example the customer comes in wants a low spec model, with Vista . i press my magic button and display all models with the criteria they want. Its not so much admin more like a backend version.Comment
-
-
Ok.
I don't like to bring bad news but it seems that it will be more complicated then it seemed before.
The problem is that- Access suspends code execution (including callbacks from OS) while mouse button is down. That means any useful code has to be in MouseDown event handler.
- No event will be fired while event handler is active and there is no conventional way to determine mouse button state in running code.
The closest solution is to write code determining how much time mouse button was down on control.
Regards,
FishComment
-
Thanks fish i got her going. I read through what you said again and relalised i had misread the the order in which the events happen. It doesn't fire till you let the mouse up again but it takes the 3 seconds into consideration.
Simple but hard if you dont know how lol. thanks again fish for all the valuable pointersCode:Private Sub Form_Timer() DoCmd.OpenForm ("pcspecs2") Me.TimerInterval = 0 End Sub Private Sub Image30_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Me.TimerInterval = 3000 End Sub
regards
PanteraboyComment
Comment