Dlookup Runtime Error 3464
Contents |
Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rating: Display Modes 09-01-2010, 01:31 PM runtime error 2471 dlookup #1 dmckie250 Registered User Join Date: Sep 2010 Posts: 12 Thanks: 0 Thanked
Runtime Error 2471 Access Dlookup
0 Times in 0 Posts VBA DLookup gives Runtime Error '3464' Hi everyone, I have been struggling with this control all day - run time error 3464 I have a form with a combo box [Employee ID] that looks up the value [Employee ID] from a table called tbl_Personnel_Details This table is linked to another table called tbl_Personnel_Status_Update which contains the field [CBD_Code]. run time error 3464 data type mismatch in criteria expression I use the query qry_Personnel_Current_Status to determine the most recent value for [CBD_Code] in relation to the [Employee ID]. I have been trying to use the following VBA code to update the combo box [Charge_Code] with the relevant [CBD_Code] using the AfterUpdate event on [Employee ID]: Code: Private Sub Employee_ID_AfterUpdate() Dim EID, CBD As String EID = Me.Employee_ID.Value 'update charge code with employee's current CBD Code CBD = DLookup("[CBD_Code]", "qry_Personnel_Current_Status", "[Employee ID] = "
Run Time Error 3464 Data Type Mismatch In Criteria Expression Vba
& EID) Me.Charge_Code.Value = CBD End Sub Whenever I try to run it I get a message saying either "Runtime Error '2001' - you cancelled the previous event" or "Runtime Error '3464' - data type mismatch". I have tried changing the query that it is getting the value for [Employee ID] from and it works fine (although it gives me a different value so this is not suitable). I have also used the correct query with different criteria (I used a field called [Equipment #]) and it works fine. the Employee ID field is a text field. Does anyone have any suggestions why its not working? Or a better way to update the field [Charge_Code] with the CBD_Code that is associated with the selected Employee ID? Thanks, Duncan dmckie250 View Public Profile Find More Posts by dmckie250 09-01-2010, 01:37 PM #2 missinglinq AWF VIP Join Date: Jun 2003 Location: Richmond (Virginia that is!) Posts: 5,649 Thanks: 11 Thanked 552 Times in 522 Posts Re: VBA DLookup gives Runtime Error '3464' If Employee ID is Text the syntax would be "[Employee ID] = '" & EID & "'" Linq ;0)> __________________ The Devil's in the Details! To view links or images in signatures your post count must be 10 or greater. You currently have
expression If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 3 of 3 Thread: run time error 3464, Data type mismatch in criteria expression Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 12-27-04,08:26 #1 mantaraya View Profile View Forum Posts Registered User Join Date Dec 2004 Posts 19 Unanswered: run time error 3464, Data type mismatch in criteria expression http://www.access-programmers.co.uk/forums/showthread.php?t=198381 run time error 3464, Data type mismatch in criteria expression Hi who can me help me out with this problem? I get the above error if I run this Dlookup. The colum RelationID comes out of an oracle table and the data type is Number. Both nummer and sDataEntryUser are Variant nummer = Me.txtRelationID sDataEntryUser = DLookup("[Data_Entry_User]", "Relations", "[RelationID] =" & "'" & nummer & "'") The funny thing is (well not so funny), nummer returns a number. If http://www.dbforums.com/showthread.php?1081562-run-time-error-3464-Data-type-mismatch-in-criteria-expression I put this number instead of the nummer in the Dlookup it gives me the information needed. What might it be. Many thankx in advanced. Reply With Quote 12-27-04,10:31 #2 Peter.t View Profile View Forum Posts Registered User Join Date Nov 2004 Posts 64 nummer = Me!txtRelationID 'if nummer is text it would be like so xx = DLookup("[textfield1]", "table1", "[TextField2]='" & nummer & "'") 'if nummer is integer it would be like so 'xx = DLookup("[Field1]", "table1", "[Field2]=" & 5) Me![FieldOnForm] = xx cheers Peter.T if its not to much trouble ymay be you could lit me know if it works Reply With Quote 12-27-04,19:14 #3 Peter.t View Profile View Forum Posts Registered User Join Date Nov 2004 Posts 64 it was late last night when I typed in my previous post, I have made some alteration just to tidy up the code nummer = Me!txtRelationID 'for text values use this code xx = DLookup("[textfield1]", "table1", "[TextField2]='" & nummer & "'") 'for integer/number values use this code xx = DLookup("[textfield1]", "table1", "[RelationID]=" & nummer) Me![ sDataEntryUser] = xx Reply With Quote Quick Navigation Microsoft Access Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Non-SQL Forums MongoDB Database Server Software Adabas DB2 Informix Microsoft SQL Server MySQL Oracle Pervasive.SQL PostgreSQL Sybase Other Data Access, Manipulation & Batch Languages ASP Crystal Reports Delphi, C etc JAVA Perl and the DB
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With http://www.tek-tips.com/viewthread.cfm?qid=1698214 Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's http://www.bigresource.com/MS_ACCESS-Modules-VBA-DLookup-data-type-mismatch-error-fh0J4p.html functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting time error Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Forms Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Forms Forum DlookUp Run Time time error 3464 Error 3464 thread702-1698214 Forum Search FAQs Links MVPs DlookUp Run Time Error 3464 DlookUp Run Time Error 3464 DraGo150 (IS/IT--Management) (OP) 14 Nov 12 11:19 Hello, trying to understand what I am doing wrong. I have a DLookup to search the table for duplicate records before update, but it keeps producing an error. Any help would be appreciated. Private Sub DOB_LostFocus() If (Not IsNull(DLookup("[LastName]", _ "tbl_Client", "[LastName] ='" _ & Me!LastName & "'"))) Then If (Not IsNull(DLookup("[FirstName]", _ "tbl_Client", "[FirstName] ='" _ & Me!FirstName & "'"))) Then If (Not IsNull(DLookup("[DOB]", _ "tbl_Client", "[DOB] ='" _ & Me!DOB & "'"))) Then Else MsgBox "Name has already been entered in the database." Cancel = True Me.Undo Dim strDocName As String strDocName = "rpt_ClientSearch" DoCmd.OpenReport strDocName, acViewReport End If End If End If End Sub RE: DlookUp Run Time Error 3464 PHV (MIS) 14 Nov 12 12:01 Replace this: "tbl_Client", "[DOB] ='" _ & Me!DOB & "'"))) Then with this: "tbl_Client", "[DOB] =#" _ & Format(M
mismatch error, Code: Dim Answer As String Dim varX As Variant Dim rst As Recordset Dim strSQL As Integer Dim stWhereStr As String Set db = CurrentDb() [Code] ..... In the table the ID field is an automatic number and the Member Number is a short text field. View Replies Similar Messages: Dlookup Type Mismatch Error Modules & VBA :: Data Type Mismatch Error When Running Sql Query Modules & VBA :: Runtime Error 3464 - Data Type Mismatch Modules & VBA :: Run Time Error - Data Type Mismatch In Criteria Expression Modules & VBA :: Getting A Type Mismatch 13 Error Data Type Mismatch Error Modules & VBA :: Error - Type Mismatch On Imports? Modules & VBA :: Email Sending Error 13 Type Mismatch Modules & VBA :: Fix Type Mismatch Error With Dcount Function? Date Parameter Cause 'data Type Mismatch Error' Queries :: Data Type Mismatch In Criteria Error Error - Data Type Mismatch In Criteria Expression Modules & VBA :: Passing Recordset To Sub Procedure - Type Mismatch Error Modules & VBA :: Type Mismatch Error On DMax Function Using Dates? Modules & VBA :: Object Read Only And Type Mismatch Error For Serial Number Criteria For Date Field Causing 'data Type Mismatch' Error General :: Error 3464 / Data Type Mismatch In Criteria Expression Passing Parameters Thru Combo Selection: ERROR:Data Type Mismatch Criteria Expression Modules & VBA :: Data Type Mismatch In Criteria Expression Mismatch Type Error Run-time Error '13': Type Mismatch Type Mismatch Error In Query Audit Trail Type Mismatch Error Queries :: Keep Getting - Type Mismatch In Expression - Error Date Import From Excel To Access - Type Mismatch Error ADVERTISEMENT Dlookup Type Mismatch Error Feb 15, 2005 Can someone please help with the following: Dim strX As Variant strX = DLookup("State", "TblScheduleK12004", "[PartnerID] = '" & Forms!FrmPrintRpt!cboClient & "'" And "[SetNum] = " & Forms!frmPrintRpt!txtSet) [PartnerID] is a text field[SetNum] = is a number field I can get it to work with the Partner ID OR the SetNum but keep getting the error when I add the "AND" to include both. View 2 Replies View Related Modules & VBA :: Data Type Mismatch Error When Running Sql Query Jan 16, 2014 I have vba code that creates the following SQL:SELECT SubscheduleID, EventID, WeekOrder, DayID, StartTime, EndTime, Priority, CanJoin, PatientTitle, PatientNickname, IncludesPatient, IncludesAftercare, Letter1 F