G
Guest
Hello all
I had posted this a month or so ago and Michael Walsh was gracious enough to help. However, I just got back to this project to try it, and was still having a some problems. So forgive me for multi posting.
I have also reduced the fields to make it easier to see the changes…. For me anyway
I have a button that updates a table with data from another table and the form
I want to be able to update even if the fields on the form are Null. Right now this code works only if all fields are populated
TxtNote and txtPO are the fields that I want to be able to leave blank
vdoSql = "INSERT INTO tbOrd (Qty, ItmNum, Notes, PONumber ) values ('" & Me.txtQty.Value & "','" & rs![ItmNum] & "', '" & Me.txtNote.Value & "','" & Me.txtPO.Value & "');
Here is what Mr. Walsh suggested.
&Nz( Me.txtNote.Value, “NULLâ€
I get a validation error when using this. There are no validation rules on the field in question as far as I can tell
Again the code in full
vdoSql = "INSERT INTO tbOrd (Qty, ItmNum, Notes, PONumber ) values ('" & Me.txtQty.Value & "','" & rs![ItmNum] & "', '" &Nz( Me.txtNote.Value, “NULLâ€) & "','" &Nz(Me.txtPO.Value, “NULLâ€) & "');
Thanks all
I had posted this a month or so ago and Michael Walsh was gracious enough to help. However, I just got back to this project to try it, and was still having a some problems. So forgive me for multi posting.
I have also reduced the fields to make it easier to see the changes…. For me anyway
I have a button that updates a table with data from another table and the form
I want to be able to update even if the fields on the form are Null. Right now this code works only if all fields are populated
TxtNote and txtPO are the fields that I want to be able to leave blank
vdoSql = "INSERT INTO tbOrd (Qty, ItmNum, Notes, PONumber ) values ('" & Me.txtQty.Value & "','" & rs![ItmNum] & "', '" & Me.txtNote.Value & "','" & Me.txtPO.Value & "');
Here is what Mr. Walsh suggested.
&Nz( Me.txtNote.Value, “NULLâ€
I get a validation error when using this. There are no validation rules on the field in question as far as I can tell
Again the code in full
vdoSql = "INSERT INTO tbOrd (Qty, ItmNum, Notes, PONumber ) values ('" & Me.txtQty.Value & "','" & rs![ItmNum] & "', '" &Nz( Me.txtNote.Value, “NULLâ€) & "','" &Nz(Me.txtPO.Value, “NULLâ€) & "');
Thanks all