cornall
05-29-2008, 01:12 AM
I have a subform that works perfectly well in Access 2000 and 2003 but displays no results in Access 2007.
If I query on a Number field I get no results e.g.
sSQL = "SELECT * FROM table WHERE NumberFieldA = 1234"
.....Form.RecordSource = sSQL
I get results in Access 2000 and 2003 but nothing in 2007
The query returns results in 2007 when run in the SQL window just not to the sub from.
If I change the query to a string field in the where clause i do get results in 2007 e.g.
sSQL = "SELECT * FROM table WHERE StringFieldA = 'abcd'"
.....Form.RecordSource = sSQL
Now for the wierd part I have found a fix that makes no sence and was found by mistake.
If I break the query that has the WHERE clause e.g.
sSQL = "SELECT * FROM table WHERE NumberFieldA = 1234 dsfas"
.....Form.RecordSource = sSQL
Run it throwing an error then fix the query it works and returns results!!!
I have tested this several times going back to my original file the only way I can fix it for 2007 is to break the query then fix the query!
This isn't an acceptable solution for me and I really want to know what is going on as I suspect this might not be the only problem during changeover to 2007!!
If I query on a Number field I get no results e.g.
sSQL = "SELECT * FROM table WHERE NumberFieldA = 1234"
.....Form.RecordSource = sSQL
I get results in Access 2000 and 2003 but nothing in 2007
The query returns results in 2007 when run in the SQL window just not to the sub from.
If I change the query to a string field in the where clause i do get results in 2007 e.g.
sSQL = "SELECT * FROM table WHERE StringFieldA = 'abcd'"
.....Form.RecordSource = sSQL
Now for the wierd part I have found a fix that makes no sence and was found by mistake.
If I break the query that has the WHERE clause e.g.
sSQL = "SELECT * FROM table WHERE NumberFieldA = 1234 dsfas"
.....Form.RecordSource = sSQL
Run it throwing an error then fix the query it works and returns results!!!
I have tested this several times going back to my original file the only way I can fix it for 2007 is to break the query then fix the query!
This isn't an acceptable solution for me and I really want to know what is going on as I suspect this might not be the only problem during changeover to 2007!!