dellehurley
Board Regular
- Joined
- Sep 26, 2009
- Messages
- 171
- Office Version
- 365
- Platform
- Windows
Hi,
Can someone tell me why my listbox suddenly started flipping the date format form dd/mm/yyyy to mm/dd/yyyy. Obviously I must have changed something but I cannot figure out what
The database which is the source shows the correct format.
This is the listbox related part of my reset procedure for the userform
This is the code behind the listbox. This selects the row clicked on a shows it in a single line listbox. This too now shows the date incorrectly.
The database is simple and userform, a screenshot below
Any ideas?
Can someone tell me why my listbox suddenly started flipping the date format form dd/mm/yyyy to mm/dd/yyyy. Obviously I must have changed something but I cannot figure out what
The database which is the source shows the correct format.
This is the listbox related part of my reset procedure for the userform
VBA Code:
.lblMths.Caption = "Upcoming Transactions."
.lstTrans.Visible = True
.lstTrans.Width = 470
.lstTrans.Height = 200
.lstTrans.ColumnCount = 7
.lstTrans.ColumnHeads = False
.lstTrans.TextAlign = fmTextAlignLeft
.lstTrans.ColumnWidths = "70,130,120,70,70,0,0"
If DbLastRow > 1 Then
.lstTrans.List = Range("Database").Value
Else
.lstTrans.List = DbWs.Range("A2:G2").Value
End If
VBA Code:
Private Sub lstTrans_Click()
Dim i As Long
Me.txtRowNo.Value = Val(Me.lstTrans.ListIndex + 1)
i = Me.txtRowNo.Value + 1
Me.lstTrans.ColumnHeads = False
If Me.lstTrans.ListIndex <> -1 Then
Me.lstSelected.Height = 18
Me.lstSelected.Font.Bold = True
Me.lstSelected.List = DbWs.Range("A" & i, "G" & i).Value
Me.lstSelected.ColumnCount = 7
Me.lstSelected.ColumnHeads = False
Me.lstSelected.ColumnWidths = "72,122,122,70,70,0,0"
End If
The database is simple and userform, a screenshot below
Any ideas?