I have a table of people with work to assign to:
I want to use the BeforeDoubleClick
Event to invoke a form showing all the relevant fields, so that the user can consult/correct the fields.
The form looks like this:
In the corresponding worksheet, I have the following code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("tblTime")) Is Nothing Then
Cancel = True
frmAssignNewWork.Show
frmAssignNewWork.Controls("cboPerson").value = Cells(Target.Row, 2).value
frmAssignNewWork.Controls("cboWork").value = Cells(Target.Row, 4).value
frmAssignNewWork.Controls("txtStartDate").value = Cells(Target.Row, 5).value
frmAssignNewWork.Controls("txtEndDate").value = Cells(Target.Row, 6).value
frmAssignNewWork.Controls("txtFocus").value = Cells(Target.Row, 7).value * 100
It works somewhat, as it shows the form, and populated fields in the right place, BUT it populates the form with the fields that were selected on the PREVIOUS double-click.
To clarify, if I double-click a first time, the form will appear with blank fields.
Then, if I double-click a second time on the same cell, it will display the correct information of that row in the correct fields.
However, if I double-click a third time on a different row, it will display the information of the former row, etc.
I would think it has to do something with the concept of "Before" double-click, but if I insert a check such as:
MsgBox (Target.Address)
It does always provide the correct address...
Anyone can help out there? :)