Access Forms prevent mouse from selecting values from dropdown, force keyb input - forms

I have a data entry form. Its properly tab indexed etc. and there are three dropdown menus which automatically unfurl with the on enter event.
No matter how much advice i give to users about using the tab key and keboard and checking what they just input.
they still insist on using the mouse to select values from the dropdown menus
the problem is that in their haste they often make mistakes as a result of using the mouse.
I would like to be able to force users to input into these fields using the keyboard.
the drop down is neccessary for users see the appropriate values for the field because the values will vary based on previous selections.
I have already tried experimenting with onclick events but to no avail.
Is there a way I can do this?
i am using access 2007 many of the users have access 2003.

Based on your comments, I would take one of two different approaches.
If your users are really comfortable with the codes AND know which ones they should use based on their previous selections, then just use text boxes instead of combo boxes. You can still put some validation code in either the Form_BeforeUpdate event or the individual control's _BeforeUpdate event.
If the users are not that comfortable, then I would suggest you have the first field in the combo boxes be the description of the code, not the code itself. So instead of choosing from 101, 102, 103 they are instead choosing from "Small", "Medium", "Large" or whatever those codes actually apply to. If you still wanted to display the codes themselves, you could do that with a separate disabled text box.
Now to answer your actual question. For the record, I highly recommend against using this approach. The simplest way I can thing of to prevent your users from using the mouse to select the combo box, would be to add a Transparent button covering the combo box.
To do this, draw a regular command button over the combo. Set Transparent = Yes, Visible = Yes, Enabled = Yes, Tab Stop = No.
When users click on the combo now, they will actually be clicking on the Transparent button and nothing will happen. The ONLY way they will be able to get into the control is by tabbing from a neighboring control or using a hotkey (via '&' in attached label).
Once they enter the control via Tab and your code forces a dropdown, they will still be able to choose an option using the mouse. But by forcing them to use the keyboard initially, it will make it much more likely that they just stick with the keyboard.
Again--I can't stress this enough--I think this is a terrible, horrible, no-good idea. Please don't use this approach. But you asked a technical question and this site is all about giving technical answers, so there you go...

Related

How to emphasise text in Word, without alter the document, like in Grammarly

I am writing a VSTO add-inn to Word (and Outlook as well). I want to emphasize certain parts of the text (detected errors). As far as I know, there is no API for this kind of emphasizing in Microsoft.Office.Interop.Word or other libraries.
But Grammarly (www.grammarly.com) has found a way to do it:
Does anyone know how you can do it the same way?
I believe that the best way to do this would be to place the desired text into a Range and then apply the following formatting:
myRange.Font.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineThick;
myRange.Font.UnderlineColor = Microsoft.Office.Interop.Word.WdColor.wdColorRed;
How This Would Work With Grammerly
As previously pointed out in the comments for the question, the only way to add the emphasis is to change the document temporarily, which is what Grammerly seems to do in a very smart way. Grammerly only works when one clicks the Open Grammerly button on the Grammerly ribbon. If you do a simple experiment, you may be able to observe how Grammerly controls its temporary changes.
First create an unsaved document with some misspelled words that show the wavy red line. Then click the Open Grammerly button. Notice that the add-in turns off spell checking and replaces it with its own web-triggered markings that are generated in the document and similar to what is generated by the code above. Then save the document. If you look carefully, you will see a small blink wherein the red thick underlines disappear for a brief moment. That is the Document.BeforeSave event removing their markings before saving the document. By relying on user actions, Grammerly controls at what points in time the markings appear. It then uses code and events to make sure the markings are not saved with the document or interfere with other operations.
Some of the events you may want to look at are the:
Document.BeforeSave Event
Document.BeforePrint Event
Document.BeforeClose Event

Create a 'Group Box' in Word Userform

"Group Box", for lack of a better word: I want areas in my user form which are visually different from others, with a different background colour and a frame around them, such as is possible to create using Frame controls. However, I want none of the events of Frame controls and none of their interaction with other controls in the form.
More particular, I want to be able to tab through all text, list, combo and check boxes, regardless of their location in 'Group Boxes', in fact also regardless of the possible location of their 'Group Box' within another 'Group Box'. Most of my controls have On Enter, On Exit, On Change and On Key even procedures attached to them which may re-direct the focus to any control on the form. Doing so under the constant interference of Frame controls with their events and rules - many of them not working correctly, none of them properly explained anywhere - is a gargantuan task. The easy way would be to have the visual design capabilities only, without the "intelligence" which assumes control in a way not compatible with my own plans.
Perhaps the one feature of frames which makes them unfit for my purposes is that they act as forms within the form, meaning they appoint an ActiveControl when activated which they refuse to release when another control takes the focus outside their own frame. It is inconvenient to prevent a first control's On Enter procedure from running when any control in a frame receives the focus (different for first and subsequent times), but it's a much bigger task to deal with the selected control's On Exit event which won't fire until the form is closed, meaning it is missed when the control optically loses the focus and a nuisance when it technically does.
Is there a control that fits my needs in MS Word? Or can the Frame control be stripped of its events in some way? Could I place a Text Box, for example, in front of a Frame control without it also being "within" it?
For MS Word use a label with a background color.
For MS Access use the rectangle Object behind the controls.
First make the form background a grey color. Then add subforms(ms access) and rectangles to segment the controls.
The end effect is it looking like a paneled interface.
You can use a Frame control. Place the other controls first, then place the Frame control, and move it to the back. This should look visually identical to having the controls in the Frame.

"Segmented Button" with Multi-line Text

I'm not sure exactly what keyword I should be searching, but I wasn't able to find the answer to my problem - I'm new to iOS development so apologies in advanced if I'm not using the correct UI components.
I want to create something like a segmented control (two choices) with multi-line descriptions in them, except I'm not sure if I should be using a segmented control to do so, or to customize a button to create it. The user should be able to select a "choice" and that will switch views and tint the choice not selected depending on the choice the user makes. How exactly would I design this / is this possible?
I've already attempted to modify the segmented control but couldn't get the desired results. I've thought about creating a text box and modifying it to act like a button selector, but wasn't sure if that was the best way. I would love some input, thanks!

When using a browser in my progress application the scroll bars never work correctly

When using a browser in my progress application the scroll bars never work correctly. It will show that I can only scroll down a little but then keeping going. Is this a bug in progress or is there something I can do to fix this problem?
define query browse-4 for customer.
DEFINE BROWSE BROWSE-4
QUERY BROWSE-4 NO-LOCK DISPLAY
custNum name
/* ENABLE name */
WITH NO-ROW-MARKERS SEPARATORS SIZE 32 BY 6.46 FIT-LAST-COLUMN.
.
open query browse-4 preselect each customer no-lock.
enable browse-4.
wait-for window-close of current-window.
You can adjust the MAX-DATA-GUESS property for the browse. You can get the value from NUM-RESULTS after the preselect query has been opened. Or you can set it to a suitable guesstimate without using preselect.
Keep in mind that using preselect causes every record to be read instead of just enough to fill the first browse window. That is potentially a lot of extra DB reads and network traffic just to get the scrollbars correct.
You may be confusing the scrollbar on the containing frame with the scrolling of the browse.
Do you see two boxes outlining the browse? If you add "with no-box" to your "enable" does the scrollbar that is bothering you go away?
If it does then the problem is that your containing frame (which is the default un-named frame because you have not specified a frame phrase with the ENABLE) is smaller than the browse viewport. So you are seeing a scrollbar on the FRAME, not on the BROWSE, that is trying to tell you that you can scroll the frame up and down to see the complete viewport of the browse. The browse may also scroll within that containing frame depending on how much data there is.
If you are running this code in a character (Unix) environment you should also be aware that many GUI features of the BROWSE are not available. Especially anything related to appearance. Like scrollbars.
This is a known "feature" of Openedge GUI, unfortunately.
The position of the slider on the right of the browse is not directly related to the number of records in the query, but to the "Max Data Guess" property of the browse.
You can set this value yourself in the property dialogue for the browse widget (it's just below the "query" editor, in v10 at least).
Just set it to a really big number (say 10,000) and the browse will behave as it should.
the main problem for my question is mainly ,i am deleting temptable before completing the excecution,that is the main reason for the vertical-scrollbar is not working,after eleminating this temp-table deletion statements .automatically vertical-scrollbar is working.
for each ttdummy:
delete ttdummy.
end.

How to add tooltip entries for items in Eclipse SWT combo

The exact already asked question to what I'd like to do is: how to add tooltip on the entries and not the combo....
I cannot use a CCombo. JoeYo said that he solved it by using a DefaultToolTip class on the Combo, but he didn't elaborate.
Can anyone, (#JoeYo hopefully) give me a bit more detail how to got the handle on the list, once dropped, to capture the mouse hover events, and then of course display the tool tip?
If I was supposed to ask for more info on the original question, I could not figure out how. I tried to comment, but was told I did not have enough credits.
DefaultToolTip is part of JFace. Other than the native tooltip of the platform, it can be freely positioned and shown/hidden. Internally it is comprised of a Shell that when shown stays on top of all other controls.
In combination with a MouseListener, the getVisibleItemCount() and getItemHeight you might be able to compute above which item (if any) the mouse cursor hovers and show a tooltip with suitable content.
This answer has a snippet that computes which item of a List widget is under the mouse pointer. It should be possible to adapt it for the Combo widget. The remaining difficulty is probably to figure out the of the drop-down and the gap between of the Combo and its drop-down.