Hey guys, have seen a few people asking the same questions but just cant seem to work it out, on my userform i enter the date as dd-mm-yyyy but when i click submit the format is automatically changed to mm-dd-yyyy on my excel sheet. For example if i enter 1/8/2023 it will change to 8/1/2023.
Thanks in advance for any help.
Here is my code, Need txtDateR and txtDateS to both come through as dd-mm-yyyy. Thanks
[/CODE]
Option Explicit
Private Sub cmdReset_Click()
Dim msgValue As VbMsgBoxResult
msgValue = MsgBox("Do you wish to reset the form?", vbYesNo + vbInformation, "Confirmation")
If msgValue = vbNo Then Exit Sub
Call Reset
End Sub
Private Sub cmdSave_Click()
Dim msgValue As VbMsgBoxResult
msgValue = MsgBox("Do you wish to save data?", vbYesNo + vbInformation, "Confirmation")
If msgValue = vbNo Then Exit Sub
Call Submit
Call Reset
End Sub
Private Sub Image1_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub txtDateR_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
txtDateR.Value = Format(txtDateR.Value, "dd-mm-yyyy")
End Sub
Private Sub txtDateS_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
txtDateS.Value = Format(txtDateS.Value, "dd-mm-yyyy")
End Sub
Private Sub txtLabRef_Change()
End Sub
Private Sub UserForm_Initialize()
Me.cmbJob1.RowSource = "tablePriceList[Test]"
Me.cmbJob2.RowSource = "tablePriceList[Test]"
Me.cmbJob3.RowSource = "tablePriceList[Test]"
Me.cmbJob4.RowSource = "tablePriceList[Test]"
Me.cmbJob5.RowSource = "tablePriceList[Test]"
Me.cmbJob6.RowSource = "tablePriceList[Test]"
Me.cmbJob7.RowSource = "tablePriceList[Test]"
Me.cmbJob8.RowSource = "tablePriceList[Test]"
Me.cmbLocate.RowSource = "tableLocate[Location]"
Call Reset
End Sub
[/CODE]