B
B. Meincke
I am trying to use the following DCount to determine if a record exists in a
table named, tblOHList and, if not, to use an update query to write the
record, taking field values from unbound textbox controls on the frmOHL form:
DCount("*", "tblOHList", "[Municipality]='" & [Forms]![frmOHL]![CITY] & "'
And [Unit No]='" &
[Forms]![frmOHL]![Unit] & "' And [Street No]= '& [Forms]![frmOHL]![StNo]'
And [Street Name]='" &
[Forms]![frmOHL]![STREET] & "'")
I have checked to make sure the data types of each field in the table
matches the corresponding query field type and the form fied type.
Municipality/CITY, Unit No/Unit, and Street Name/STREET are all text. Street
No/StNo are numeric.
I think the problem is that, like a lot of times, I have turned to these
newsgroups for help and copied and pasted syntax and revised it to fit my
needs. This time I am at a total loss as to what I am overlooking. I have
read a number of threads on the subject and have checked the data types and
made the four fields being checked required to ensure there are no null
values involved.
If it would help I can post the SQL for the query and the full click event
syntax for the form.
Any assistance in repairing this code would be greatly appreciated. Thanks
in advance for any help.
table named, tblOHList and, if not, to use an update query to write the
record, taking field values from unbound textbox controls on the frmOHL form:
DCount("*", "tblOHList", "[Municipality]='" & [Forms]![frmOHL]![CITY] & "'
And [Unit No]='" &
[Forms]![frmOHL]![Unit] & "' And [Street No]= '& [Forms]![frmOHL]![StNo]'
And [Street Name]='" &
[Forms]![frmOHL]![STREET] & "'")
I have checked to make sure the data types of each field in the table
matches the corresponding query field type and the form fied type.
Municipality/CITY, Unit No/Unit, and Street Name/STREET are all text. Street
No/StNo are numeric.
I think the problem is that, like a lot of times, I have turned to these
newsgroups for help and copied and pasted syntax and revised it to fit my
needs. This time I am at a total loss as to what I am overlooking. I have
read a number of threads on the subject and have checked the data types and
made the four fields being checked required to ensure there are no null
values involved.
If it would help I can post the SQL for the query and the full click event
syntax for the form.
Any assistance in repairing this code would be greatly appreciated. Thanks
in advance for any help.