Topics Search

"FieldName" is not an index in this table. Error 3800

"FieldName" is not an index in this table. Error 3800
Views: 30
This is the code I'm using, error line highlighted:

Option Compare Database Public Function VerifyAcct(AcctNum As String) Dim dbDatabase As Database Dim rsAcctNumber As Recordset Set dbDatabase = CurrentDb Set rsAcctNumber = dbDatabase.OpenRecordset("CAM_Portfolio_Query", dbOpenTable) With rsAcctNumber
.Index = "Account-Number"
.Seek "=", AcctNum
If .NoMatch = True Then
MsgBox "NotFound"
Else
MsgBox "Found"
End If End With
End Function

It is giving me Runtime 3800, "FieldName" is not an index in this table.
In the table CAM_Portfolio_Query, I set the [Account-Number] field to be both the key and indexed, with no duplicates allowed.

Yet I still get this error
Sponsored Links:

Similar posts...

 

If Statement : multiple OR criteria

If Statement : multiple OR criteria Icon
If I put an Iff statement into a Query such as:

IIf([Table A]![FieldName] Like "A" Or [Table A]![FieldName] Like "B","Answer A", "Answer B")

It works ok but as the table name is the same why do I have to repeat it. If I try:

IIf([Table A]![FieldName] Like "A" Or Like "B","Answer A", "Answer B")

It does not seem to evaluate correctly.

This means that multiple "Or" criteria referencing the same field results in very long queries. I know you dont need to in VBA but I am doing this in a query grid.
 

Module Problem

Module Problem Icon
I ran an "Analyze Performance" on one of my tables and it suggested to index a particular field in a table that is created by running an append module. Now that I have created this index I am getting corruption errors and when I select my module I get the error; "The module name 'modImportData' is misspelled or refers to a module that doesn't exist".

Should Itake off the index in the table or is there a way to redo the module to account for the index? It is a big table and want it to run as fast as possible when I run a query off it.
 

Change duplicate values Error Msg in the index, primary key, or relationship

Change duplicate values Error Msg in the index, primary key, or relationship Icon
folk,

Does anybody knows how to control the the below msg to something like this through VBA:
"The Item: " & ItemNo & " already exists in the table."
instead of this:
Msg:
"The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."

What is the Err.Number for this error?
 

error 3251 using table.index = "primaryKey" on an Access back-end table

error 3251 using table.index = "primaryKey" on an Access back-end table Icon
Office 2007, XP Pro SP3

routine:
....
tblLoans.Index = "PrimaryKey"
 

Import Table Error

Import Table Error Icon
I get error msg: "The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."
when I try to import a .csv file. I googled and could only find reference where there is a problem with autonumbering or an existing table field: [LINK]
This does not apply as I get the error when importing into Access 2007 a new .csv table.
 

CreateRelation error 3409

CreateRelation error 3409 Icon
I want to rebuild a table (new) with indices and relationship links to the other tables (old) in my db. I have followed examples but can't seem to shake the 3409 error - "Invalid field definition [field_name] in definition of index or relationship".
[code]
Error 3409 pops on the append.rel statement. I've examined the index I created on the old table. The field name I used to create the index is the same field name used to build the relationship. Both fields are primary keys. There are records in both tables.

On a related topic, if I want to recreate a table that has been dropped for some reason, what I understrand is that I can create an index on the table before populating it with data but I cannot create a relationship to another table until the recreated table has data in it. Is that correct?
 

"not an index in this table" error

"not an index in this table" error Icon
I have a file somewhere that seems to be corrupted and I don't know what to do. "Id" is not an index in this table is the error message I'm getting
 

VB Code using variables for Forms controls

VB Code using variables for Forms controls Icon
Like to put the form property name in a variable. I have a table that controls form element. Hols formname, fieldname, Propertyname and the Value I want the property set to.

Formnname = "test_form"
FieldName = "command0"
Propertyname = "Visible"
Forms(Formname).Form(FieldName).Propertyname = False


Can not seem to figure out if you can put the property name as a variable like the form name and fieldname.
 

Problem Indexing Table in Access

Problem Indexing Table in Access Icon
I have a large database (3 millions lines) that I'm trying to index. The table is called ITEM_TRANSACTIONS and the field I want to index is called ITEM_NUMBER.

Every time I try to index, (I go in design view and set the "index" to yes with duplicates OK.

Error:
CANNOT OPEN DATABASE ITEM_NUMBER. It may not be a database that you application recognizes, or the file is corrupt.

Item_number is a field not a database. It just don't get it. I've tried to index other fields. same outcome.
 

Function to select field from a table using several criteria

Function to select field from a table using several criteria Icon
I am new to VBA and need help creating a function to select data from a table in the current database. I would like the function to accept parameters (fieldname, tablename, one or more criteria). I would call the function from any other procedure or from a query field. I am using Access 2007 in the XP.

I would call the function as in this example:

MyFunction("fieldname","tblTableName","criteria1 = 5 and criteria2 = 45")

It would be nice if it accepted numeric as well as strings in the criteria