Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search criteria TYPE MISMATCH 1

Status
Not open for further replies.

lalee5

Technical User
Oct 20, 2002
70
0
0
US
I have problems with the following search criteria: it is giving me a type mismatch error when I run the program.

Searchcriteria = "DATE=" & todaydate.Text And "socialsecno = " & txtpassword.Text

I want only the record matching the above criteria to show. there is only one record per employee. once the record match I want to be able to update fields in that record and update the record again.

Please help me!!!


thanks


kay

 
I really need a way around this. I want to be able to update the record after it meets the two criteria

Please help me figure out what is the best way to go about this.


thanks

kay
 
Well the most obvious approach to me is to do it in two steps. Find the entries using the Date, clone the Recordset then apply the SocSecID filter the the cloned copy.

Update the record then store the results.

I'm sure this would work, but others may correct me.



William
Software Engineer
ICQ No. 56047340
 
The link I provided shows a way around your issue. It uses a clone of the recorset to get the bookmark of where the record you are searching for resides. After you get the position all you have to do is move to that record and then edit and update it.

Swi
 
ADO connection Execute method on a simple SQL update query?:

Dim strNew As String
Dim cnn As New ADODB.Connection
Dim strSQL As String
cnn.Open _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\user.mdb;"
strSQL = "Update tblUser set [username] = 'FRED' where clockindate = '" & todaydate.Text & "' And socialsecno = " & txtpassword.Text

cnn.Execute strSQL, , adCmdText
Set cnn = Nothing


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
kay,
I like johnwm's idea the most. There's so much more flexibility in using a plain connection object and pure SQL statements that I never found a need to use anything else.

JC

Friends are angels who lift us to our feet when our wings have trouble remembering how to fly...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top