[AccessD] A2K: Can anyone tell me why this fails?

Stuart McLachlan stuart at lexacorp.com.pg
Wed Feb 18 00:17:24 CST 2004


I'd guess that FomattedStudentID is a text filed in which case you 
need:

FROM tblStudents WHERE (((tblStudents.FormattedStudentID)='" &
[Forms]![frmStudentSearch]![txtStudentIDSearch] & "'));"

Note the single quote after the "=" and before the first ")" in the 
second line.

On 18 Feb 2004 at 16:53, Darren DICK wrote:

> Thanks Steve
> Now I get
> Data Type mismatch in expression as the error message
> 
> ----- Original Message ----- 
> From: "Developer" <Developer at UltraDNT.com>
> To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com>
> Sent: Wednesday, February 18, 2004 4:29 PM
> Subject: RE: [AccessD] A2K: Can anyone tell me why this fails?
> 
> 
> > You hve to build the string like this:
> > 
> > selSQL = "SELECT tblStudents.StudentID, tblStudents.FormattedStudentID
> > FROM tblStudents WHERE (((tblStudents.FormattedStudentID)=" &
> > [Forms]![frmStudentSearch]![txtStudentIDSearch] & "));"
> > 
> > --Steve
> > 
 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.






More information about the AccessD mailing list