473,508 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trouble with FindFirst and variable

11 New Member
I'm having issues using FindFirst with a variable in one of my recordsets. I have the following code:

Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim rcdsetActive As DAO.RecordSet
  3. Dim acctID As String
  4.  
  5. acctID = Me.ID
  6. 'ID of current record. Autonumber
  7.  
  8. Set db = CurrentDb
  9. Set rcdsetActive = db.OpenRecordset("SabreUsers", dbOpenDynaset)
  10.  
  11. rcdsetActive.FindFirst ("[ID] = '" & acctID & "'")
  12. If Not rcdsetActive.NoMatch Then
  13.     rcdsetActive.Edit
  14.     rcdsetActive!FirstName = "OPEN"
  15.     rcdsetActive.Update
  16. End If
  17.  
When I run this I get a runtime error 3464, data type mismatch in criteria expression, with the FindFirst line highlighted in the debugger. I have a form showing active users of an application and want to open the recordset and edit the current record. ID is the primary key. I set the string variable acctID equal to the record ID and want to pass it to the FindFirst function. Any thoughts on what's going wrong?
Oct 26 '11 #1
2 5906
Smecker
11 New Member
I found my answer. I needed to remove the single quotes.
Oct 26 '11 #2
NeoPa
32,557 Recognized Expert Moderator MVP
Indeed. And the parentheses.
Oct 27 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
3286
by: Bill | last post by:
For my personal use I am accessing a railway timetable page, parsing its contents and then sending brief relevant information as the subject line of an email to be read on a mobile phone. The...
8
1573
by: Olaf Martens | last post by:
Greetings! Here's another problem that appeared recently: I have the following function call: l_test->Compress(&"filename.dat",l_buf); l_test is a pointer-to-packer that I want to check...
9
2146
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
3
1383
by: Unknown | last post by:
Hello i am new to C# and am having trouble with variable access.. What I am doing is just making a timer, and within the tick event I want a variable to increase a number.. for example tick...
2
1930
by: Chris | last post by:
Hi, I'm having trouble with variable scope inside procedures. this is pseudocode LDAP NewUser; if (something = true) { NewUser = LDAP.FindUser(use emailaddress)
59
7433
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.