data input GUI

whitmore

New member
Local time
Tomorrow, 01:06
Joined
Apr 22, 2011
Messages
3
I wish to create a data entry input which uses a horizontal time scale which represents a 24:00 hour format. The GUI would look like a drivers work diary page. The time slots are 15 minute intervals. The data input would come from using a mouse to complete the time line on the form to enter the hours required.
I have seen similar done in DELPHI and I want to see if I can do the same for my Access database. I have attached a similar page for reference.
any help greatly appreciated thanks
 

Attachments

  • work diary page.JPG
    work diary page.JPG
    63.1 KB · Views: 104
It could be done with Continous Forms.

Set up a row of controls right against each other with the control showing the date at the left. Select and Cut the lablels and Paste them to the form header.

Checkboxes would work.

It could also be done with textboxes. Use the click procedure to set the value and Conditional Formatting to set the background colour.

A datasheet would provide similar funcitionality but the Continuous Forms provides better formatting opportunities.
 
Thanks for the reply. I got as far as setting up multiple checkboxes but foud I had to click every box rather than click and drag along in a horizontal dierection to span the number of hours requied to be recorded.
 
The click and drag would be a problem because the focus does not move while the mouse is dragged with the button down.

However you could do a ClickFirst and then Shift-ClickLast like in Windows file selections.

See the MouseDown and MouseUp events. They provide an argument for the Mouse button in combination with the Shift key. The procedure would have to loop through all the controls between the two that were clicked and change the value. You would need some kind of naming pattern or a numbering system in the Tag property of the controls so the procedure would know the range to be affected.

Write that as a sub and call it from each control's MouseDown or MouseUp procedure. Use Screen.ActiveControl.Name property to get the name of the control that was clicked.

Probably best to use the textboxes rather than the checkboxes because they won't change state on the click.
 
WOW thanks I like that idea. Seems like I might have a bit of a job ahead of me. Better get started
If there is anything existing that may shorten my job would be nice.

Thanks
 
Seems like I might have a bit of a job ahead of me.

Best plan the behaviour and process carefully before getting too much into coding.

The core of it is a loop through a range of contols so get that naming system or Tag system sorted first.

A click without the shift should change the state of that control and must also store the identity or name of the control that was clicked in a module level variable to be referred to when Shift click is encountered.

Remember you will probably want to be able to deselect like this too so you are looking at a toggle process. Don't forget the first click will have already changed the state of the first control in the range.

If there is anything existing that may shorten my job would be nice.

I was involved in a thread at this site a year or two ago discussing how to avoid requiring the procedure calling code on every control by implementing a custom class and associating the procedure with the class. Unfortunately I can't find it nor remember exactly how that was done.

Maybe post another question about that and hopefully one of the really knowledgable members will be able to explain it. However be prepared for a fairly involved learnng curve if you don't have any experience with custom classes.
 

Users who are viewing this thread

Back
Top Bottom