Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings,
I nearly have this completed. The User form works great for input, and deletion. The problem now is the edit, and it is only the date column. When I select my row on my form to edit the cells get populated but the Date Cell is incorrect. I provided my current macro. Columns 2 through 4 I know without a doubt are correct. Its is the first Column. I've been moving things around and still cannot get it to work. Any suggestions would be great. I originally had the line
and everything shifted to the left on the form, so the weight column was blank. That is how I know it is the date I need to put right.
Thank you,
I nearly have this completed. The User form works great for input, and deletion. The problem now is the edit, and it is only the date column. When I select my row on my form to edit the cells get populated but the Date Cell is incorrect. I provided my current macro. Columns 2 through 4 I know without a doubt are correct. Its is the first Column. I've been moving things around and still cannot get it to work. Any suggestions would be great. I originally had the line
Excel Formula:
Me.date.Value = Me.lstactivity.List(Me.lstactivity.ListIndex, 1)
VBA Code:
Private Sub cmdEdit_Click()
If Selected_list = 0 Then
MsgBox "No row is selected.", vbOKOnly + vbInformation, "Edit"
Exit Sub
End If
'code to update the value of respective controls
Me.txtRowNumber.Value = Selected_list + 1
.Value = CDate(Me.Txtdate) = Me.lstactivity.List(Me.lstactivity.ListIndex, 1)
Me.Txtmission.Value = Me.lstactivity.List(Me.lstactivity.ListIndex, 2)
Me.Cmbmode.Value = Me.lstactivity.List(Me.lstactivity.ListIndex, 3)
Me.Cmbdenton_fms.Value = Me.lstactivity.List(Me.lstactivity.ListIndex, 4)
Me.Txtweight.Value = Me.lstactivity.List(Me.lstactivity.ListIndex, 5)
MsgBox "Please make the required changes and click on 'Save' button to update,", vbOKOnly + vbInformation, "Edit"
End Sub
Thank you,