Excel vba detect when any control form is clicked - excel

I have a random number of radio buttons created dynamically according to table data. These buttons are all inside a Frame and each is individually named. What event controller or such do I use in order to detect which button has been clicked? I've put them all into the same 'GroupName'. I've tried groupname_click(), frame1_click(), mousedown_event detect. I'm not sure how to go about this.

Related

Excel and VBA form editing only

I've been trying to produce a form for the company I work at to automatically produce a specification with information inputted using excels form control drop down boxes and buttons. I have managed to produce the code that produces the required results but was just wondering if it is possible to make it so that the user can only choose from the drop down menus and press the buttons. I have seen that parts of the spreadsheet can be locked but I have struggled when trying to use this on all of my drop down boxes and buttons. I would also like to make it so the inputs (drop down boxes) are within another window maybe? Or if there is a way the inputs could pop up as a form outside of excel in order to make it look more professional. What the sheet looks like at the moment is below.

VBA Excel array of control ComandButtons to create a full panel from code

I am creating a game for playing Sink The Fleet human vs the program I made. I have near 5000 lines of code in the user form. I have 200 buttons and I have copied and pasted the same code for all the buttons (1 day of bored work changing some part of the name).
What I would like to do for the next time is to create an array of buttons to program all the buttons with a for loop. I can define a matrix of command buttons then I build the buttons in this way
Set Button(j, i) = UserForm2.Controls.Add("Forms.CommandButton.1")
and the buttons appear on the userform but I can not call to commandbuttons_click in the code because the button doesn't exist in memory before I run the user form.
Does anyone know a way to do it? Or a way to call a function when I push the button?

Xpages chained djFilteringSelect in separate dialogs

I am trying to make a 2nd djFilteringSelect using a #Dbcolumn depending on the value selected in the 1st djFilteringSelect control. That's a common task, using a partial refresh. However, each of the controls is within a dialog control from the extension library. One dialog pops up, the user selects a value, and automatically the 1st dialog closes and the 2nd opens. YOU CAN'T SEEM TO REFRESH THE FIELD (I'm guessing b/c it's not in the DOM). I've tried writing the first value to to an computed field and/or a text box on the main Xpage using CSJS and then looking for that value for the second lookup. Also, tried with SSJS, etc. I tried do updates and writing to fields on either the onChange or on the click of button. How do I go about using the selected value of the first to do the lookup in the 2nd?
You can use a single dialog control where you hide and show the relevant controls. I am using this approach in several apps.

Toggle a custom icon on an Action Button on Lotus Notes form

When editing the action button properties, it allows an #if statement to flip/flop two choices (lock/unlock). i.e. #If(enlock=1;"Unlock";"Lock") for the "Label" of the action button.
At the bottom of the Action properties, icons can be None, Notes, or Custom. When I select Custom, I want the #if to use either the Locked/Unlocked Notes icons. (actn084.gif and actn085.gif, respectively) Or numbers #62 (locked) and #(I don't know/can't find, the # for the unlock icon).
I've tried formula with the icon number, like in a view, "display as icons" for view column. Using an #if, I've tried the gif on local and server replica's and it didn't give any results.
Please see the example image below.
Image example: http://i.stack.imgur.com/UBac3.png
You have to add actn084.gif and actn085.gif to Resources/Images.
Then, you can use a formula
#If(enlock=1;"actn085.gif";"actn084.gif")
for calculating icon.
As an alternative, you could create two buttons and hide-when them depending on field enlock. You could assign label and icon direct to buttons without formula then.
The hide formula would be enlock=1 for first button and enlock!=1 for the second. In both buttons you would have to add #Command([RefreshHideFormulas]); at the end of your action formula to refresh the action buttons (or Call uiDoc.RefreshHideFormulas for LotusScript action code).

vba-excel click event triggered during initialize when load data into a text box

I am using VBA Excel. I am formatting data from several sources to display in a text box (as a quick summary), when the user clicks on this text box I have another userform that will display to edit this data. When I move the data into the text box during initialize the click event triggers. Is there a way to turn off the event during initialize then turn it back on? This does not happen if I have the user do the double click, however I would like it to be a single click if possible for consistency with the rest of the maintenance screens.
If the click event triggers then you must be using the wrong event make sure that the event handler does not look like this TextBox1_Change() if so change the event to DblClick

Resources