Hi All,
I'm currently using an update query for a form for users and I'm running into problems.
the form consists of text fields that allow users to enter their details, once completed they then click a save button which allows them to choose one of two options, add new or modify existing.
If the user only fills half of their details in and clicks add new, these values insert into the relevant tables allowing them to come back another time to fill in the rest of their details
using DLookups the user can populate the form with their exisiting details that they have already inserted, so that they can see and carry on modifying their data, but when they click modify existing, the original textfields that were left blank do not update, but the fields that were filled in originally do update.
So for example if the user saves their details as below:
Name.text = peter
address.text = left blank
if i modified the name.text to david and address.text to 123road, the name.text updates to david but the address still stays blank
The section of code im having trouble with is below.
any help would be amazing.
I'm currently using an update query for a form for users and I'm running into problems.
the form consists of text fields that allow users to enter their details, once completed they then click a save button which allows them to choose one of two options, add new or modify existing.
If the user only fills half of their details in and clicks add new, these values insert into the relevant tables allowing them to come back another time to fill in the rest of their details
using DLookups the user can populate the form with their exisiting details that they have already inserted, so that they can see and carry on modifying their data, but when they click modify existing, the original textfields that were left blank do not update, but the fields that were filled in originally do update.
So for example if the user saves their details as below:
Name.text = peter
address.text = left blank
if i modified the name.text to david and address.text to 123road, the name.text updates to david but the address still stays blank
The section of code im having trouble with is below.
Code:
CurrentDb.Execute "UPDATE Material_Cost SET Part_No_Length = '" & Forms!frmEnquiryDetails!Part_No_length & "', Weight_Per1000 = '" & Forms!frmEnquiryDetails!Weight_Per1000 & "', " _
& "Finished_Weight_kg = '" & Forms!frmEnquiryDetails!Finished_Weight_kg & "', Scrap_Rate_kg = '" & Forms!frmEnquiryDetails!Scrap_Rate_kg & "', " _
& "Costing_Time = '" & Forms!frmEnquiryDetails!Costing_Time & "', Percentage = '" & Forms!frmEnquiryDetails!Percentage & "', Scrap_Value = '" & Forms!frmEnquiryDetails!Scrap_Value & "' " _
& "WHERE Finished_Weight_kg = " & Forms!frmEnquiryDetails!Finished_Weight_kg & ";", dbFailOnError