473,569 Members | 2,617 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 5922
Smecker
11 New Member
I found my answer. I needed to remove the single quotes.
Oct 26 '11 #2
NeoPa
32,564 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
3294
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 problem comes when I try to parse a second page, the url of which, I have derived from an initial page. I cannot go directly to the second (target)...
8
1579
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 here. The file name thing should be plain enough, whereas l_buf is declared as a
9
2157
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 type="text/javascript"> function radioenable(value) { document.forms.search.elements.value.disabled=false;
3
1385
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 event: integervar++; end event
2
1939
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
7464
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 the recordset opens a table. When I write Set rst = db.OpenRecordset("MyTable",dbOpenTable, dbReadOnly) I get an error. I believe it's...
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.