What is Error 2465 (1 Viewer)

Port_J

New member
Local time
Today, 06:06
Joined
Sep 6, 2007
Messages
5
Hi, All

Am relatively new to using VBA so I apologise for the state of my code,

I am having problems with runtime error 2465, it seems to be looking for a field “I” referred to in my Expression, but from my knowledge this field does not exist in any of my source tables,
I have run debug thoroughly and the error is occurring in the very last section of script

“Form.[Sub_RecordSearch].Form.[Sub_RecordSearch_Sub].RecordSource = SearchTable”

Can anyone please explain what Runtime error 2465 actually is and how do I fix it.

I’ve also included attached my full procedure if this is any help.
 

Attachments

  • Sample Script.txt
    4.1 KB · Views: 547

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:06
Joined
Jul 9, 2003
Messages
16,271
Is there an error here?
rs.Open "SearchTempTable", CurrentProject.Connection, adOpenStatic

SearchTable = rs.GetRows(RecCount)

Shouldn't it be:
rs.Open "SearchTempTable", CurrentProject.Connection, adOpenStatic

SearchTempTable = rs.GetRows(RecCount)
 

Port_J

New member
Local time
Today, 06:06
Joined
Sep 6, 2007
Messages
5
Cheers, for the help on this, ive been stumped for two days
fighting with this error,

Ive made the change and re-run the script unfortunatley, its Still returning the same error,
I think you descoverd completley diferent error there. :-(
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:06
Joined
Jul 9, 2003
Messages
16,271
Actually looking at the code again, I don't think that was an error, I'm not sure.....

I can't find "SearchTable" in your code, could it be a table in your database?
 

Port_J

New member
Local time
Today, 06:06
Joined
Sep 6, 2007
Messages
5
I think that was a Typo on my side really, it should be SearchTempTable,

Once this is changed and the code restarted i still get the same error it always occurs as the script is about to end,

By stepped though the code using the intermediate window and debug.print co check my variables i still cannot find any reference to the problematic field.

Cheers for the help.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:06
Joined
Jul 9, 2003
Messages
16,271
It would be handy if I could see what your code was doing, so I suggest this, at the end of the code the following section add a message box where shown:

SearchTable = rs.GetRows(RecCount)
'ADD Messagebox Here
MsgBox " >>> " & SearchTable
rs.Close
Set rs = Nothing

Form.[Sub_RecordSearch].Form.[Sub_RecordSearch_Sub].RecordSource = SearchTable

End Sub

you can copy the message from the message box by using the keyboard shortcut Ctrl C

and post a message here.
 

Port_J

New member
Local time
Today, 06:06
Joined
Sep 6, 2007
Messages
5
Message Box Results

Ok i've inserted the Code for the message box and the only message I get is

---------------------------
Microsoft Access
---------------------------
>>>
---------------------------
OK
---------------------------

Then the runtime time error 2465 message occurs.

I’ve had another think about what exactly am trying to do here and if there is a different way about it.
At the moment as you can probably see I am attempting to display the data from the SearchTempTable into a sub form by passing the table into an array and then basing the sub form on that array.

I did try to base the sub form on the "SearchTempTable" by assigning the sub forms record source to "SearchTempTable" but in order to then operate the procedure, the parent form and sub form are both open open and actively reading from their respective source tables, this then prevents the procedure updating the SearchTempTable as it is currently being read from by the open sub form.
"I hope this makes some sense"
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:06
Joined
Jul 9, 2003
Messages
16,271
>>> display the data from the SearchTempTable into a sub form by passing the table into an array and then basing the sub form on that array. <<<

I'm not sure that's possible, however it would be very interesting if it was!

usually you set the record source for the subform to an SQL statement described in a string: "SELECT * FROM SubForm_SearchTempTable"
 

Port_J

New member
Local time
Today, 06:06
Joined
Sep 6, 2007
Messages
5
Right, Ill take that as a resolution to my issue then,

Ill have to make a much simpler form.

Cheers for all your help, much appreciated
 

Users who are viewing this thread

Top Bottom