I have an A2003 database linked to SQL Server 2005. My problem is
with a popup form with a filtered table as a recordsource. I set the
filter with an SQL statement like this:
SELECT * FROM tblMedicalTraits WHERE SystemID = " & CLng(Me.OpenArgs)
Me.RecordSource = strSQL
This opens the popup form just fine when there are records that meet
the filter. If there are no records, then the popup displays 2
"blank" records. What I expect to see is one blank record. It's
almost like there is already a record out there but it's blank. (This
could be better explained if I could attach a screen-shot of what I'm
seeing.) If I try to close the popup without entering anything, I get
an error message that a null cannot be inserted into a field in
tblMedicalTraits. It's referring to the SystemID column in
tblMedicalTraits.
This does not happen if there are records already in the table that
meet the filter criteria. I can enter/edit/delete records just fine.
It happens only when there are no records.
tblMedicalTraits has an IDENTITY field in it so that it will link
correctly to the mdb. It also has a TIMESTAMP field in it to avoid
any write conflicts that these types of databases sometimes get. I
tried removing both thinking that one of them was causing this
problem. But if I remove the IDENTITY field, I just get a popup form
with no fields on it at all, just the outline of the form
Has anybody had this problem? If so, what did you do to correct it?
Thanks for any help or advice.