hi, Sam !
> The controls are linked to cells (with their ControlSource set to the cells).
> The problem I had was that when the worksheet updates, not all these controls update to reflect the changed value.
> So what I do now is to code each control's value to its corresponding cell in the subroutine CommandButton_Click().
> This ensures all controls always show their linked cells value in real time when click the button, and it's working fine.
> I just wonder if there's an easier way to refresh multiple form controls without referring to the worksheet in the code like I did
> (as the form controls already have their ControlSource specified in property)?
I'm not so sure I'm following you quite accurately -?-
I used a form with one textbox, one combobox and one checkbox (one commandbutton for "other" purposes)
(controlsource are A1, B1 and C1 respectively)
when I use each control, it's cell (controlsource) updates accordingly
when I click the userform, code "blanks" the range (A1:C1] and controls refresh to show the (new) data in their cells
when I click on a commandbutton, code "puts" data in source cells (obviously, controls do reflect this changes)
here is what I used in userform code-module:
Private Sub CommandButton1_Click()
[a1:c1] = Array("Test text", "Name 03", False)
End Sub
Private Sub UserForm_Click()
[a1:c1].ClearContents
End Sub
hth,
hector.
__ previous posts __
>>> I have several controls (i.e. textbox, combobox and checkbox) inside a frame in a form
>>> and need ALL their values to update to their corresponding cells in a worksheet when click a command button.
>>> Is there a quicker way to do so rather than writing a line for each control to force the blanket update? ...
>>
>> (assuming every control is "linked" to each cell)...
>> try "blanking" (in one step) "their corresponding cells" -?-
|