473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Error: Jet Cannot Find 'tblBehavioralRating'

I get that error when trying to create an error message when entering duplicate employee name by attaching to a field with a list box to the before update event. Here is the code I am using and I have tried everything including renaming the table so there is not a space between Behavioral Rating. Can anyone help?
Expand|Select|Wrap|Line Numbers
  1. Private Sub Employee_Name_BeforeUpdate(Cancel As Integer)
  2.  Dim Answer As Variant
  3.  
  4.  Answer = DLookup("[Employee_Name]", "tblBehavioralRating", "[Employee_Name] = '" & Me.Employee_Name & "'")
  5.  If Not IsNull(Answer) Then
  6.   MsgBox "Employee Record already exists" & vbCrLf & "Please use Find Record to Edit Button.", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate"
  7.  
  8.   Cancel = True
  9.   Me.Employee_Name.Undo
  10.  
  11.  Else:
  12.  End If
  13. End Sub
Jan 26 '12 #1
3 1186
Rabbit
12,516 Expert Mod 8TB
What line is the error on and what is the error text?
Jan 26 '12 #2
dsatino
393 256MB
I think you should probably fix some other issues before trying to solve this. I have no idea what you're doing of course but, in general, using a name as unique identifier is not good practice since names are not unique. I'd guess there's probably an employee table and, hopefully, each employee has some sort of unique ID. You should use that instead. Which then brings us to the question of why you need a table for this. If an employee can have only one behavioral record, is there a reason for an additional table? Or maybe you just need to add a field(s) to your employee table.
Jan 26 '12 #3
NeoPa
32,556 Expert Mod 16PB
Lisa, as Rabbit says this question (including title) makes no sense without the basic information. Surely no-one could possibly consider the error code alone adequate - without specifying even the line it occurred on or the text of the error message. Please remember in future as it will waste less of people's time and effort.

I looked up the error message from the number and it pertains to the table name supplied not matching any table or query in your database. From that I infer that your DLookup() line (#4) has the problem and that the problem is that your table is not actually called [tblBehavioralRating] at all. If the actual table name has a space in it then you can refer to it in the code as follows :
Expand|Select|Wrap|Line Numbers
  1. Answer = DLookup("[Employee_Name]", _
  2.                  "[tblBehavioral Rating]", _
  3.                  "[Employee_Name] = '" & Me.Employee_Name & "'")
PS. DSatino's point is also a good one and you should follow that up ;-)
Jan 27 '12 #4

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

Similar topics

0
by: TERMAN, IRA, ALABS | last post by:
Hello, I am trying to install Python-2.3. I get the following error when I run ./configure --with-csx=gcc on my Solaris machine. config.status: error: cannot find input file:...
2
by: Liber Almeida | last post by:
I have a problem when install a Visual C#. Net application, using Crytal Reports, under Windows98: error: "cannot find KeycodeV2.dll or invalid Keycode" Help me please, Thank you, Liber...
0
by: Matthew Louden | last post by:
I am trying to implement the sort event in data grid. I set the data grid's AllowSorting property = True. I implement the following code that should be the event will fire when the user click any...
3
by: POL8985 | last post by:
The application is developed in ASP.Net with a SQL Server database. Essentially, the application uses a single shared Connection object for all users logged into the system. The connection...
0
by: RJN | last post by:
Hi I'm having VS.Net 2003 in my development machine and report works fine in my machine. The deployment server is Windows 2003 server, it only has the framework installed. Since the framework...
10
by: antonis | last post by:
When I restarting my pc a warning appears with the error cannot find the file C:\winnt\system32\1.tmp Please advice me how can I solve this problem Thanks
0
by: DongWook | last post by:
Hi, I've a windows application with crystal viewer to show a report (using vb .net 2003). I made a setup project and installed on client machines (no .net and crystal report). The application...
0
by: SMH | last post by:
Hi All, I am currently learning .Net 2, studying for 70-528. I've hit a bit of a brick wall with DataColumn.Expression. As I understand it, this can be used to (For example) concatenate two...
2
by: sam.barker0 | last post by:
Hi , I am having 3 functions.When I step through when func b returns to funca.it throws an error "cannot find function bounds" funca() { .... ... funcb(); }
1
by: blondsecret | last post by:
Hello everyone, after installing a Strokes 'easylearning' CD-Rom, following dialogue is shown to me: Microsoft .NET Framework An unhandled exception has occurred in a component in your...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.