S
steveatdb
Hi I have a form used to edit the details in a table.
In the form I have a bunch of text boxes which display the current text held
in the cells from the table specified by critera that the user has selected
from a combo box above. I then have a second set of textboxes to the right of
these which the user can use to edit the detail displayed on the left. I then
have a cmd button which when clicked runs a update query. The update query
that I thought I made updates all of the feilds in the table to what is
entered into the textboxes unless they are Null. However when I run the query
it wont up date any of the feilds if any of the textboxes are null. I created
it using design mode however here is a copy of the query in SQL code. If
anyone could help me rewrite the code so that it works as desired or if they
have any other suggestions as a workaround that would be most appreciated.
UPDATE FACILITY_DESCRIPTION SET FACILITY_DESCRIPTION.SectionCode =
[Forms]![frmeditfacility]![txtNSectionCode], FACILITY_DESCRIPTION.Description
= [Forms]![frmeditfacility]![txtNDescription], FACILITY_DESCRIPTION.ShortID =
[Forms]![frmeditfacility]![txtNShortID],
FACILITY_DESCRIPTION.DocCollection_ID =
[Forms]![frmeditfacility]![txtNDocument_CollectionID],
FACILITY_DESCRIPTION.SectionHead =
[Forms]![frmeditfacility]![txtNSectionHead], FACILITY_DESCRIPTION.Sorter =
[Forms]![frmeditfacility]![txtNSorter], FACILITY_DESCRIPTION.Details =
[Forms]![frmeditfacility]![txtNDetails]
WHERE
(((FACILITY_DESCRIPTION.SectionCode)=[Forms]![frmeditfacility]![txtSectionCode])
AND
((FACILITY_DESCRIPTION.Description)=[Forms]![frmeditfacility]![txtDescription])
AND ((FACILITY_DESCRIPTION.ShortID)=[Forms]![frmeditfacility]![txtShortID])
AND
((FACILITY_DESCRIPTION.DocCollection_ID)=[Forms]![frmeditfacility]![txtDocument_CollectionID])
AND
((FACILITY_DESCRIPTION.SectionHead)=[Forms]![frmeditfacility]![txtSectionHead])
AND ((FACILITY_DESCRIPTION.Sorter)=[Forms]![frmeditfacility]![txtSorter]) AND
((FACILITY_DESCRIPTION.Details)=[Forms]![frmeditfacility]![txtDetails]) AND
(([Forms]![frmeditfacility]![txtNSectionCode]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNDescription]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNShortID]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNDocument_CollectionID]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNSectionHead]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNSorter]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNDetails]) Is Not Null));
Thanks
In the form I have a bunch of text boxes which display the current text held
in the cells from the table specified by critera that the user has selected
from a combo box above. I then have a second set of textboxes to the right of
these which the user can use to edit the detail displayed on the left. I then
have a cmd button which when clicked runs a update query. The update query
that I thought I made updates all of the feilds in the table to what is
entered into the textboxes unless they are Null. However when I run the query
it wont up date any of the feilds if any of the textboxes are null. I created
it using design mode however here is a copy of the query in SQL code. If
anyone could help me rewrite the code so that it works as desired or if they
have any other suggestions as a workaround that would be most appreciated.
UPDATE FACILITY_DESCRIPTION SET FACILITY_DESCRIPTION.SectionCode =
[Forms]![frmeditfacility]![txtNSectionCode], FACILITY_DESCRIPTION.Description
= [Forms]![frmeditfacility]![txtNDescription], FACILITY_DESCRIPTION.ShortID =
[Forms]![frmeditfacility]![txtNShortID],
FACILITY_DESCRIPTION.DocCollection_ID =
[Forms]![frmeditfacility]![txtNDocument_CollectionID],
FACILITY_DESCRIPTION.SectionHead =
[Forms]![frmeditfacility]![txtNSectionHead], FACILITY_DESCRIPTION.Sorter =
[Forms]![frmeditfacility]![txtNSorter], FACILITY_DESCRIPTION.Details =
[Forms]![frmeditfacility]![txtNDetails]
WHERE
(((FACILITY_DESCRIPTION.SectionCode)=[Forms]![frmeditfacility]![txtSectionCode])
AND
((FACILITY_DESCRIPTION.Description)=[Forms]![frmeditfacility]![txtDescription])
AND ((FACILITY_DESCRIPTION.ShortID)=[Forms]![frmeditfacility]![txtShortID])
AND
((FACILITY_DESCRIPTION.DocCollection_ID)=[Forms]![frmeditfacility]![txtDocument_CollectionID])
AND
((FACILITY_DESCRIPTION.SectionHead)=[Forms]![frmeditfacility]![txtSectionHead])
AND ((FACILITY_DESCRIPTION.Sorter)=[Forms]![frmeditfacility]![txtSorter]) AND
((FACILITY_DESCRIPTION.Details)=[Forms]![frmeditfacility]![txtDetails]) AND
(([Forms]![frmeditfacility]![txtNSectionCode]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNDescription]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNShortID]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNDocument_CollectionID]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNSectionHead]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNSorter]) Is Not Null) AND
(([Forms]![frmeditfacility]![txtNDetails]) Is Not Null));
Thanks