PC Review


Reply
Thread Tools Rate Thread

adodb rst find

 
 
=?Utf-8?B?SGVhdGhlciBWZXJub24=?=
Guest
Posts: n/a
 
      30th Mar 2006
I keep getting an error ("Arguments are of the wrong type, are out of
acceptable range, or are in conflict with one another") with my
rstAnimals.find command if my string strTagID starts with a letter. But I
don't get an error if strTagID starts with a number (regardless of whether
there are other letters in the string). If I nest my string in quotes, like
would make sense, I don't get an error BUT I can't find my strTagID in my
recordset if it starts with a number (I'm not sure if it finds the record if
strTagID starts with a letter). Hopefully one of you can see an obvious
solution that I can't. I'd rather not check if the first character is
numeric, and then execute a different find command for each case (if it even
works when the string starts w/ a letter).

rstAnimals.Open "SELECT Right([tblAnimalInfo]![TagId],4) As Ref, " & _
" tblCollection.CollectionId" & _
" FROM tblCollection INNER JOIN (tblAnimalInfo INNER JOIN
tblSelections ON" & _
" tblAnimalInfo.AnimalId = tblSelections.AnimalId) ON" & _
" tblAnimalInfo.AnimalId = tblCollection.AnimalID" & _
" WHERE " & strIDs, _
CurrentProject.Connection, adOpenStatic, adLockReadOnly
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SGVhdGhlciBWZXJub24=?=
Guest
Posts: n/a
 
      30th Mar 2006
Here's the rest of my code; seems to have been lost...

rstAnimals.MoveFirst
rstAnimals.Find "[Ref] = " & strTagID & ""

--
Heather Vernon

 
Reply With Quote
 
Douglas J Steele
Guest
Posts: n/a
 
      31st Mar 2006
If Ref is a text field, you need quotes around the value:

rstAnimals.Find "[Ref] = " & Chr$(34) & strTagID & Chr$(34)

or

rstAnimals.Find "[Ref] = '" & strTagID & "'"

(exagerated for clarity, that second one is rstAnimals.Find "[Ref] = ' " &
strTagID & " ' ")

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Heather Vernon" <(E-Mail Removed)> wrote in message
news:00E6B755-B523-4BF0-8761-(E-Mail Removed)...
> Here's the rest of my code; seems to have been lost...
>
> rstAnimals.MoveFirst
> rstAnimals.Find "[Ref] = " & strTagID & ""
>
> --
> Heather Vernon
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB Find/ Seek method in C# 2005 Bryan Microsoft C# .NET 9 20th Oct 2007 05:00 AM
How to find full field name in ADODB ? Michel S. Microsoft Access 6 13th Aug 2006 10:54 PM
Strange behaviour with rs.Find (ADODB) Mark Microsoft Access ADP SQL Server 2 14th Jun 2006 04:43 PM
XL & Access 2000, ADODB and the Find Method Mike Mertes Microsoft Excel Programming 0 29th Jul 2004 03:27 PM
using New ADODB.Recordset to Find =?Utf-8?B?SmltIFNob3Jlcw==?= Microsoft Access VBA Modules 3 18th Jun 2004 06:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:06 AM.