Bob Gajewski
rbgajewski at adelphia.net
Thu Jun 9 14:09:59 CDT 2005
Mike I may be missing something, but if this can return one and only one record, why are you using an ORDER BY clause? Bob Gajewski -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Thursday, June 09, 2005 14:48 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Value Retrieval Mike, 1) You have an unneeded space at the end of FROM tblInventory. 2) Check the rules on field names - is a + sign usable? 3) Try running this without DISTINCT to see if it works then. HTH! Dan Waters -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gowey Mike W Sent: Thursday, June 09, 2005 10:46 AM To: Access Developers discussion and problem solving Subject: [AccessD] Value Retrieval I'm wondering if someone can get me out of my brain freeze: I want to be able to display the value of the following select statement on a form. It should only find one tag number since I do not allow duplicates. I want to be able to see the results on the form. strSQL = "SELECT DISTINCT tblInventory.[DOC Tag Number+] FROM tblInventory " strSQL = strSQL & " WHERE tblInventory.[DOC Tag Number+] = '" & Tag & "'" strSQL = strSQL & " ORDER BY tblInventory.[DOC Tag Number+];" Thanks in advance for any advice. Mike Gowey MCDST, A+, LME, NET+ Team Leader - East Region Information Systems Unit -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com