Hello everyone, I am facing problem whereby my record is not saved even after i click onto the "Save" button on my access form. May i know what causes this issue?
Below is my code:
Below is my code:
Code:
If Me.txtGLGPO.Tag & "" = "" Then
'this is for insert new
'add data to table
CurrentDb.Execute "INSERT INTO ModifyMainTable(GLGPO,Mill,[Solid/Printing],Reference,FabricDelivery,GarmentDelDate,Fabrication,Width,FinishedGoods,GSMPerSqYd,Colour,LabDipCode,GrossWeight,NettWeight,Lbs,Loss,Yds,Remarks,POType,ComboName,GroundColour,GarmentSketch,BuyerRequirement)" & _
" VALUES(" & Me.txtGLGPO & ",'" & Me.cboMill & "','" & Me.cboSP & "','" & Me.cboRef & "','" & Me.txtFabricDelivery & "','" & Me.txtGarmentDelDate & "','" & Me.txtFabrication & "','" & Me.txtWidth & "','" & Me.txtFinishedGood & "','" & _
Me.txtGSMsq & "','" & Me.txtColour & "','" & Me.txtLabDipCode & "','" & Me.txtGrossweight & "','" & _
Me.txtNettweight & "','" & Me.txtLbs & "','" & Me.txtLoss & "','" & _
Me.txtYds & "','" & Me.txtRemarks & "','" & Me.cboPoType & "','" & _
Me.txtGroundColour & "','" & Me.txtComboName & "','" & Me.txtGarmentSketch & "','" & Me.txtBuyerRequirement & "')"
Else
'otherwise ( Tag of txtGLGPO store the GLGPO to be modified)
CurrentDb.Execute "UPDATE ModifyMainTable " & _
" SET GLGPO = " & Me.txtGLGPO & _
", Mill = '" & Me.cboMill & "'" & _
", [Solid/Printing] = '" & Me.cboSP & "'" & _
", Reference = '" & Me.cboRef & "'" & _
", FabricDelivery = '" & Me.txtFabricDelivery & "'" & _
", Fabrication = '" & Me.txtFabrication & "'" & _
", Width = '" & Me.txtWidth & "'" & _
", FinishedGoods = '" & Me.txtFinishedGood & "'" & _
", GSMPerSqYd = '" & Me.txtGSMsq & "'" & _
", Colour = '" & Me.txtColour & "'" & _
", LabDipCode = '" & Me.txtLabDipCode & "'" & _
", GrossWeight = '" & Me.txtGrossweight & "'" & _
", NettWeight = '" & Me.txtNettweight & "'" & _
", LBS = '" & Me.txtLbs & "'" & _
", Loss = '" & Me.txtLoss & "'" & _
", Yds = '" & Me.txtYds & "'" & _
", Remarks = '" & Me.txtRemarks & "'" & _
", POType = '" & Me.cboPoType & "'" & _
", ComboName = '" & Me.txtComboName & "'" & _
", GroundColour = '" & Me.txtGroundColour & "'" & _
", GarmentSketch = '" & Me.txtGarmentSketch & "'" & _
", SampleRequirement = '" & Me.txtBuyerRequirement & "'" & _
" WHERE GLGPO = " & Me.txtGLGPO
End If