473,406 Members | 2,273 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,406 software developers and data experts.

Error 2465 - Can't find field 'forms' ???

MLH
"The following unexpected error occurred in Sub CopyMySQLbttn_Click,
line #250, CBF on frmVehicleChooserform. 2465: "Can't find the field
'forms' referred to in your expression. You may have misspelled the
field name, or the field may have been renamed or deleted."

The above error is returned when running the following click code.
I don't understand what the error means.

Private Sub CopyMySQLbttn_Click()
On Error GoTo ErrorCopyMySQLbttn_Click
Dim ThisForm As String
ThisForm = Me.Name

100 Dim dtxt As Object
125 Set dtxt = Me!TextHolder
150 Me!TextHolder = MySQL
175 DoCmd.GoToControl "TextHolder"
200 dtxt.SelStart = 0
225 dtxt.SelLength = 13
250 DoCmd.RunCommand acCmdCopy
275 MsgBox "Done"

ExitCopyMySQLbttn_Click:
Exit Sub

ErrorCopyMySQLbttn_Click:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub
CopyMySQLbttn_Click, line #" & Trim$(CStr(Erl)) & ", CBF on " &
ThisForm & "."
k = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & k
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume ExitCopyMySQLbttn_Click

End Sub

Nov 15 '05 #1
6 2766
MLH
BTW, the following works fine...

100 Dim dtxt As Object
125 Set dtxt = Me!TextHolder
'150 Me!TextHolder = MySQL
150 Me!TextHolder = "abcdefghijlkmnopqrstuvwxyz"
175 DoCmd.GoToControl "TextHolder"
200 dtxt.SelStart = 0
225 dtxt.SelLength = 13
250 DoCmd.RunCommand acCmdCopy
275 MsgBox "Done"

But MySQL is a global string - nothing more. The case in
which I'm using it, it is a 445-char string. Ideas on why it
fails?
Nov 15 '05 #2
MLH
And, this works too...

100 Dim dtxt As Object
125 Set dtxt = Me!TextHolder
150 Me!TextHolder = CStr(MySQL)
'150 Me!TextHolder = "abcdefghijlkmnopqrstuvwxyz"
175 DoCmd.GoToControl "TextHolder"
200 dtxt.SelStart = 0
225 dtxt.SelLength = 13
250 DoCmd.RunCommand acCmdCopy
275 MsgBox "Done"

It seems that A97 is trying to do something other than simply
pasting the string when line 150 reads...
Me!TextHolder = MySQL

I wonder what that might be? BTW, Me!TextHolder is an
unbound textbox control.
Nov 15 '05 #3
MLH <CR**@NorthState.net> wrote in
news:rc********************************@4ax.com:
And, this works too...

100 Dim dtxt As Object
125 Set dtxt = Me!TextHolder
150 Me!TextHolder = CStr(MySQL)
'150 Me!TextHolder = "abcdefghijlkmnopqrstuvwxyz"
175 DoCmd.GoToControl "TextHolder"
200 dtxt.SelStart = 0
225 dtxt.SelLength = 13
250 DoCmd.RunCommand acCmdCopy
275 MsgBox "Done"

It seems that A97 is trying to do something other than simply
pasting the string when line 150 reads...
Me!TextHolder = MySQL

I wonder what that might be? BTW, Me!TextHolder is an
unbound textbox control.


What's in the variable MySQL? Does it perhaps include a reference to
a control on a subform, such as this:

WHERE Field=Forms!MyForm!SubForm.Form!MyControl

If that's the source of the problem, this is precisely the kind of
thing I was trying to bring to your attention with DLookup() -- your
SQL string should resolve the value of that control before it is
stored, rather than depending on the SQL to be able to use the
Access expression service to resolve it.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 15 '05 #4
MLH
What's in the variable MySQL? Does it perhaps include a reference to
a control on a subform, such as this:

WHERE Field=Forms!MyForm!SubForm.Form!MyControl

If that's the source of the problem, this is precisely the kind of
thing I was trying to bring to your attention with DLookup() -- your
SQL string should resolve the value of that control before it is
stored, rather than depending on the SQL to be able to use the
Access expression service to resolve it.


I think that's probably what was going on. Using CStr(MySQL) was
enough to past the string into the control as a simple string w/o any
attempt to process it further.
Nov 15 '05 #5
MLH <CR**@NorthState.net> wrote in
news:ne********************************@4ax.com:
What's in the variable MySQL? Does it perhaps include a reference
to a control on a subform, such as this:

WHERE Field=Forms!MyForm!SubForm.Form!MyControl

If that's the source of the problem, this is precisely the kind of
thing I was trying to bring to your attention with DLookup() --
your SQL string should resolve the value of that control before it
is stored, rather than depending on the SQL to be able to use the
Access expression service to resolve it.


I think that's probably what was going on. Using CStr(MySQL) was
enough to past the string into the control as a simple string w/o
any attempt to process it further.


No, that wouldn't do the trick at all. CStr() does not evluate the
contents of what it is passed.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 15 '05 #6
MLH
I think that's probably what was going on. Using CStr(MySQL) was
enough to past the string into the control as a simple string w/o
any attempt to process it further.


No, that wouldn't do the trick at all. CStr() does not evluate the
contents of what it is passed.


I cannot understand why it works. I do know that if I take it out -
the error occurs and when I put it back in - the error disappears.
Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JMCN | last post by:
hello i receive a runtime error '2465' whenever i run my module in access 97. it says 'Run-time error '2465' OOB Reports can't find the field "DuplicatePayments' referred to in your...
5
by: Lyn | last post by:
Hi, this has been driving me nuts. I'm on Office 2003 SP1, Win XP SP1. I am opening a form with a number of subforms based on various tables. The subforms are populated via the main form's...
6
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order...
3
by: MIG | last post by:
I had a form which used year(date) to compare an input value with the year of today's date. This was working fine. Now, for some reason, I am getting run-time error 2465 "Library Catalogue...
1
by: chris | last post by:
I have a form that is labeled Document Control. On this form it calls an API Function to browse for a folder, puts its in to the text box and allows you to create a table out of the folders...
7
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter,...
4
imrosie
by: imrosie | last post by:
Hello all, Yes, another newbie...HELP please. I have a problem compiling a procedure on a form. The 'search customer' form was built on a query. The proc is attached to command button which opens...
3
by: ontherun | last post by:
hi, i have two forms CHS_Customer and 'CHS_Job' both have a common field, "Company_Name" i want to open the form 'CHS_Job' from the form 'CHS_Customer ' and when i open, the Company_Name field...
1
by: Gilberto | last post by:
Hello I have a big BIG problem. Im new with acces and ive been creating a db for a month now. It was working perfectly and just after i did a db SPLIT some functions began displaying error 2465. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.