Could someone run through my code (below) please and tell me how to make it work ??? It just reaches the EOF and reports no match. And YES one does exist !
Its meant to search the field Dte (date format) in the Table TblDteList (no primary key) and display the value that matches the criteria '01/07/*'
I've used this code succesfully before, but never with the WildCard *
[bold]
Dim Rs1 As New ADODB.Recordset
Dim SQLCode, StrResult As String
Dim cnn As ADODB.Connection
'start search
Set Rs1 = New ADODB.Recordset
Set cnn = CurrentProject.Connection
'build up the SQL code
'
SQLCode = "SELECT TblDteList.dte FROM TblDteList WHERE (((TblDteList.dte) Like '01/07/*'));"
Rs1.Open SQLCode, cnn
'try and assign a value to StrResult - if it can then the process continues
'as normal, OR it will error out at this point
'and go to the error handler
StrResult = Rs1!dte
[/bold]
Steady ...![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
Its meant to search the field Dte (date format) in the Table TblDteList (no primary key) and display the value that matches the criteria '01/07/*'
I've used this code succesfully before, but never with the WildCard *
[bold]
Dim Rs1 As New ADODB.Recordset
Dim SQLCode, StrResult As String
Dim cnn As ADODB.Connection
'start search
Set Rs1 = New ADODB.Recordset
Set cnn = CurrentProject.Connection
'build up the SQL code
'
SQLCode = "SELECT TblDteList.dte FROM TblDteList WHERE (((TblDteList.dte) Like '01/07/*'));"
Rs1.Open SQLCode, cnn
'try and assign a value to StrResult - if it can then the process continues
'as normal, OR it will error out at this point
'and go to the error handler
StrResult = Rs1!dte
[/bold]
Steady ...
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)