ili_sophia
Registered User.
- Local time
- Today, 09:22
- Joined
- Aug 23, 2017
- Messages
- 40
hi there,
i have a date time stamp on a form but i realise that it will save the date and time when the form is opened.
i would like for the actual date and time to be saved when the save command button is clicked.
i have tried to add the code Me.DateTimeStamp = Now() but it gives the error of you can't assign a value to this object
code for save button:
Private Sub cmdSave_Click()
'Insert data to MaximMaintable by using SQL
CurrentDb.Execute "Insert into MaximMainTable (GLGPO,Mill,[Solid/Printing],Reference,FunctionalFinish,MRName,Buyer,MXDPO,GLA,StyleNo,FabricDelivery,GarmentDelDate,Country,Fabrication,AfterFabricWashWidth,Width,FinishedGoods,GSMPerSqYd,GSMAfterWash,Colour,GroundColour,ComboName,LabDipCode,SampleRequirement,GrossWeight,NettWeight,Lbs,Loss,Yds,Remarks,GarmentSketch,[GarmentSketch2],[GarmentSketch3],[GarmentSketch4],[GarmentSketch5],PrintedRemarks,FabricWeight,UnitPrice,Line,PPSample,POStatus,Amendment,SketchRemark1,SketchRemark2,SketchRemark3,SketchRemark4,SketchRemark5,DateTimeStamp)" & _
"Values (" & Me.txtGLGPO & ",'" & Me.cboMill & "','" & Me.cboSP & "','" & Me.cboReference & "','" & Me.cboFunctionalFinish & "','" & Me.txtMRName & "','" & Me.txtBuyer & "','" & Me.txtMXDPO & "','" & Me.txtGLA & "','" & Me.txtStyleNo & "','" & Me.txtFabricDelivery & "','" & Me.txtGarmentDelDate & "','" & Me.txtCountry & "','" & Me.txtFabrication & "','" & Me.txtFabricWashWidth & "','" & Me.txtWidth & "','" & Me.txtFinishedGoods & "','" & _
Me.txtGSMsq & "','" & Me.txtGSMAfterWash & "','" & Me.txtColour & "','" & Me.txtGroundColour & "','" & Me.txtComboName & "','" & Me.txtLabDipsCode & "','" & Me.txtBuyerRequirement & "','" & Me.txtGrossweight & "','" & _
Me.txtNettweight & "','" & Me.txtLbs & "','" & Me.txtLoss & "','" & _
Me.txtYds & "','" & Me.txtRemarks & "','" & Me.txtGarmentSketch & "','" & Me.txtGarmentSketch2 & "','" & Me.txtGarmentSketch3 & "','" & Me.txtGarmentSketch4 & "','" & Me.txtGarmentSketch5 & "','" & Me.txtPrintedRemarks & "','" & Me.txtFabricWeight & "','" & Me.TXTuNITpRICE & "','" & Me.txtLine & "','" & Me.txtPPSample & "','" & Me.txtPOStatus & "','" & Me.txtAmendment & "','" & Me.txtSketchRemark1 & "','" & Me.txtSketchRemark2 & "','" & Me.txtSketchRemark3 & "','" & Me.txtSketchRemark4 & "','" & Me.txtSketchRemark5 & "','" & Me.DateTimeStamp & "')"
Me.DateTimeStamp = Now()
'Click on save, all the fields in the textbox will be clear
cmdClear_Click
'Refresh data in list on form to show only data that are not save
UnmatchFabricPOqrysubform.Form.Requery
End Sub
i have a date time stamp on a form but i realise that it will save the date and time when the form is opened.
i would like for the actual date and time to be saved when the save command button is clicked.
i have tried to add the code Me.DateTimeStamp = Now() but it gives the error of you can't assign a value to this object
code for save button:
Private Sub cmdSave_Click()
'Insert data to MaximMaintable by using SQL
CurrentDb.Execute "Insert into MaximMainTable (GLGPO,Mill,[Solid/Printing],Reference,FunctionalFinish,MRName,Buyer,MXDPO,GLA,StyleNo,FabricDelivery,GarmentDelDate,Country,Fabrication,AfterFabricWashWidth,Width,FinishedGoods,GSMPerSqYd,GSMAfterWash,Colour,GroundColour,ComboName,LabDipCode,SampleRequirement,GrossWeight,NettWeight,Lbs,Loss,Yds,Remarks,GarmentSketch,[GarmentSketch2],[GarmentSketch3],[GarmentSketch4],[GarmentSketch5],PrintedRemarks,FabricWeight,UnitPrice,Line,PPSample,POStatus,Amendment,SketchRemark1,SketchRemark2,SketchRemark3,SketchRemark4,SketchRemark5,DateTimeStamp)" & _
"Values (" & Me.txtGLGPO & ",'" & Me.cboMill & "','" & Me.cboSP & "','" & Me.cboReference & "','" & Me.cboFunctionalFinish & "','" & Me.txtMRName & "','" & Me.txtBuyer & "','" & Me.txtMXDPO & "','" & Me.txtGLA & "','" & Me.txtStyleNo & "','" & Me.txtFabricDelivery & "','" & Me.txtGarmentDelDate & "','" & Me.txtCountry & "','" & Me.txtFabrication & "','" & Me.txtFabricWashWidth & "','" & Me.txtWidth & "','" & Me.txtFinishedGoods & "','" & _
Me.txtGSMsq & "','" & Me.txtGSMAfterWash & "','" & Me.txtColour & "','" & Me.txtGroundColour & "','" & Me.txtComboName & "','" & Me.txtLabDipsCode & "','" & Me.txtBuyerRequirement & "','" & Me.txtGrossweight & "','" & _
Me.txtNettweight & "','" & Me.txtLbs & "','" & Me.txtLoss & "','" & _
Me.txtYds & "','" & Me.txtRemarks & "','" & Me.txtGarmentSketch & "','" & Me.txtGarmentSketch2 & "','" & Me.txtGarmentSketch3 & "','" & Me.txtGarmentSketch4 & "','" & Me.txtGarmentSketch5 & "','" & Me.txtPrintedRemarks & "','" & Me.txtFabricWeight & "','" & Me.TXTuNITpRICE & "','" & Me.txtLine & "','" & Me.txtPPSample & "','" & Me.txtPOStatus & "','" & Me.txtAmendment & "','" & Me.txtSketchRemark1 & "','" & Me.txtSketchRemark2 & "','" & Me.txtSketchRemark3 & "','" & Me.txtSketchRemark4 & "','" & Me.txtSketchRemark5 & "','" & Me.DateTimeStamp & "')"
Me.DateTimeStamp = Now()
'Click on save, all the fields in the textbox will be clear
cmdClear_Click
'Refresh data in list on form to show only data that are not save
UnmatchFabricPOqrysubform.Form.Requery
End Sub