Hello,
Having some random issues with dates.
I have removed any date formatting in the actual table for dates.
I have set the form properties to show Med Date format.
Where I am we use DD/MM/YYYY as opposed to the American format.
Some dates are coming thru correct as per sample below: (Look at "Target Dates, IFA and Sample Subm" these dates are generated from the Job Confirmed Date at top)
The amount of days are coming from a table.
If I look at another record the dates are are correct but around the wrong way, as in 8/10/21 but reading 10/8/21. (See below)
If I look into the immediate window the dates are formatting as I would like
Here is the code: (where can I add a format date function to these dates?)
Thank you
Having some random issues with dates.
I have removed any date formatting in the actual table for dates.
I have set the form properties to show Med Date format.
Where I am we use DD/MM/YYYY as opposed to the American format.
Some dates are coming thru correct as per sample below: (Look at "Target Dates, IFA and Sample Subm" these dates are generated from the Job Confirmed Date at top)
The amount of days are coming from a table.
If I look at another record the dates are are correct but around the wrong way, as in 8/10/21 but reading 10/8/21. (See below)
If I look into the immediate window the dates are formatting as I would like
Here is the code: (where can I add a format date function to these dates?)
Code:
Private Sub BtnUpdate_Click()
Dim db As Database
Dim sql As String, sVal1 As String, sVal2 As String
Dim con As Object
Dim rs As Object
Dim dDate As Date
Dim iLoop As Integer, iDays As Integer, iAcct As Integer
Set con = Application.CurrentProject.Connection
Set db = CurrentDb
CboJobTypeID.SetFocus
If CboJobTypeID.Text = "" And Nz(Me.Lead_Date, "") = "" Then
Exit Sub
End If
If CboJobTypeID.Text = "" Then
MsgBox "Please select a Job Type from the list", vbInformation, "Select Job Type"
Exit Sub
End If
If (Lead_Date.Value & "" = "") And (ChkIFA_App = True) Then
Lead_Date.Value = Now()
End If
Me.Refresh
iDays = 0
If ChkIFA_App = True Then
sql = "UPDATE JobInfoT SET IFA_Due = #" & AddDays(GetDays("IFA_Due"), 2) & "#,SampleSubm_Due = #" & AddDays(GetDays("SampleSubm_Due"), 2) & _
"#,IFC_Due = #" & AddDays(GetDays("IFC_Due"), 1) & "#,SetOutDue = #" & AddDays(GetDays("SetOutDue"), 1) & _
"#,CarcassCut_Due = #" & AddDays(GetDays("CarcassCut_Due"), 1) & "#,CarcassEdge_Due = #" & AddDays(GetDays("CarcassEdge_Due"), 1) & _
"#,PFBCut_Due = #" & AddDays(GetDays("PFBCut_Due"), 1) & "#,PFBEdge_Due = #" & AddDays(GetDays("PFBEdge_Due"), 1) & _
"#,WhiteSatinCut_Due = #" & AddDays(GetDays("WhiteSatinCut_Due"), 1) & "#,TwoPakPartsOut_Due = #" & AddDays(GetDays("TwoPakPartsOut_Due"), 1) & _
"#,PickHW_Due = #" & AddDays(GetDays("PickHW_Due"), 1) & "#,HingeDrill_Due = #" & AddDays(GetDays("HingeDrill_Due"), 1) & _
"#,MachineShop_Due = #" & AddDays(GetDays("MachineShop_Due"), 1) & "#,DrawerAss_Due = #" & AddDays(GetDays("DrawerAss_Due"), 1) & _
"#,AssemblyDue = #" & AddDays(GetDays("AssemblyDue"), 1) & "#,TwoPakUnderC_Due = #" & AddDays(GetDays("TwoPakUnderC_Due"), 1) & _
"#,TwoPakPaint_Due = #" & AddDays(GetDays("TwoPakPaint_Due"), 1) & "#,WrapQC_Due = #" & AddDays(GetDays("WrapQC_Due"), 1) & _
"#,Delivery_Due = #" & AddDays(GetDays("Delivery_Due"), 1) & "# WHERE JobID = " & Me.JobID
Else
sql = "UPDATE JobInfoT SET IFA_Due = #" & AddDays(GetDays("IFA_Due"), 2) & "#,SampleSubm_Due = #" & AddDays(GetDays("SampleSubm_Due"), 2) & _
"#,IFC_Due = """",SetOutDue = """",CarcassCut_Due = """",CarcassEdge_Due = """",PFBCut_Due = """",PFBEdge_Due = """",WhiteSatinCut_Due = """",TwoPakPartsOut_Due = """", PickHW_Due = """",HingeDrill_Due = """",MachineShop_Due = """",DrawerAss_Due = """",AssemblyDue = """",TwoPakUnderC_Due = """",TwoPakPaint_Due = """",WrapQC_Due = """",Delivery_Due = """" WHERE JobID = " & Me.JobID
End If
db.Execute sql
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Refresh
End Sub
Thank you