ACTEBS
actebs at actebs.com.au
Wed Feb 18 00:34:18 CST 2004
Bruce,
Try this:
selSQL = "SELECT tblStudents.StudentID, tblStudents.FormattedStudentID
FROM tblStudents WHERE (((tblStudents.FormattedStudentID)=" & "'"
[Forms]![frmStudentSearch]![txtStudentIDSearch] & "'));"
Regards
Vlad
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Wednesday, 18 February 2004 4:53 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] A2K: Can anyone tell me why this fails?
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
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
> Sent: Tuesday, February 17, 2004 11:54 PM
> To: AccessD List
> Subject: [AccessD] A2K: Can anyone tell me why this fails?
>
>
> Hello all
> I get a very long runtime error number along with the text... No value
> given for one or more required parameters
>
> The sql string works well as a query
> '###########################################
> Dim selSQL As String
> Dim rs As Object
> Dim con As Object
>
> selSQL = "SELECT tblStudents.StudentID, tblStudents.FormattedStudentID
> FROM tblStudents WHERE
> (((tblStudents.FormattedStudentID)=[Forms]![frmStudentSearch]![txtStud
> en
> tIDSearch]));"
>
> Set rs = CreateObject("ADODB.Recordset")
> Set con = Application.CurrentProject.Connection
>
> rs.Open selSQL, con, 1, 3 '<=====DEBUG YELLOWS OUT THIS LINE
>
> With rs
> .MoveFirst
> .MoveLast
> .MoveFirst
> MsgBox .RecordCount
> End With
> '###########################################
>
> _______________________________________________
> 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
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com