ExcelEndeavor
New Member
- Joined
- Oct 13, 2020
- Messages
- 49
- Office Version
- 365
- Platform
- MacOS
I have a double-click event that opens a userform where data can be edited. I don't want the Invoice Number to be edited, so I added the line "AddInvoiceForm.TxtInvoiceNumber.Enabled = False" to disable it, but now the Invoice Date returns as MS date code. See the before and after screenshots below. How do I get the date to return correctly again?
Before I added the code:
After I added the code:
VBA Code:
Private Sub lbxInvoiceList_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim selectedRow As Integer
selectedRow = lbxInvoiceList.ListIndex
If selectedRow >= 0 Then
AddInvoiceForm.TxtInvoiceNumber.Value = lbxInvoiceList.List(selectedRow, 0)
AddInvoiceForm.TxtInvoiceNumber.Enabled = False
AddInvoiceForm.TxtInvoiceDate.Value = lbxInvoiceList.List(selectedRow, 1)
AddInvoiceForm.TxtInvoiceAmount.Value = lbxInvoiceList.List(selectedRow, 2)
AddInvoiceForm.Show
End If
End Sub
Before I added the code:
After I added the code: