473,320 Members | 1,838 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,320 software developers and data experts.

Runtime error 2465

imrosie
222 100+
hello experts,

Im a newbie in need of someone's experience. I have an image repository db that allows the input and search images just fine. However, if I want to erase an image, the subroutine doesn't allow it. I get a compile error everytime and I've tried to correct with no success. Here's the code:

Private Sub cmdErasePic_Click()
If Not IsNull([imageFile]) Then
If MsgBox("The image will be removed from this record. Are you sure?", vbYesNo + vbQuestion) = vbYes Then
[imgPicture].Picture = ""
[imageFile] = Null
SysCmd acSysCmdClearStatus
Call Form_Current
End If
End If
End Sub


The imgPicture is a part of the subform within the form. imageFile is the actual picture stored within the image table.

The message I get is "Microsoft Access can't find the field '|' referred to in your expression.What could I be missing? Please help...thanks in advance.
May 16 '07 #1
6 4757
Denburt
1,356 Expert 1GB
Well if [imgPicture] is in a subform you should address it like so:
Expand|Select|Wrap|Line Numbers
  1. me!YourSubForm.Form![imgPicture]
You mentioned the [imageFile] is a field in a table but I am not sure which form is tied to this table or if it even is. If the [imageFile] is in a table that is bound to the subform then you will address it the same other wise you need to make sure it is also adressed somehow even if it is on the form with the button.
Expand|Select|Wrap|Line Numbers
  1. Me!imageFile
May 16 '07 #2
ADezii
8,834 Expert 8TB
hello experts,

Im a newbie in need of someone's experience. I have an image repository db that allows the input and search images just fine. However, if I want to erase an image, the subroutine doesn't allow it. I get a compile error everytime and I've tried to correct with no success. Here's the code:

Private Sub cmdErasePic_Click()
If Not IsNull([imageFile]) Then
If MsgBox("The image will be removed from this record. Are you sure?", vbYesNo + vbQuestion) = vbYes Then
[imgPicture].Picture = ""
[imageFile] = Null
SysCmd acSysCmdClearStatus
Call Form_Current
End If
End If
End Sub


The imgPicture is a part of the subform within the form. imageFile is the actual picture stored within the image table.

The message I get is "Microsoft Access can't find the field '|' referred to in your expression.What could I be missing? Please help...thanks in advance.
The Error is being generated from the line ==I> If Not IsNull([imageFile]) Then
What exectly is [imageFile] referring to?
May 16 '07 #3
imrosie
222 100+
Well if [imgPicture] is in a subform you should address it like so:
Expand|Select|Wrap|Line Numbers
  1. me!YourSubForm.Form![imgPicture]
You mentioned the [imageFile] is a field in a table but I am not sure which form is tied to this table or if it even is. If the [imageFile] is in a table that is bound to the subform then you will address it the same other wise you need to make sure it is also adressed somehow even if it is on the form with the button.
Expand|Select|Wrap|Line Numbers
  1. Me!imageFile

Hello and thanks for your quick reply. I did use the Me!subformname[imgPicture], that took away the earlier msg and now gives me a new one, 438 (object doesn't support this property or method. ???

As for imageFile , it is a field in the image table (with the stored paths to images). The main form is based off of this table (imageFile and other field). The subform is a part of the main form.

Any suggestions on the 438? thanks so much
May 16 '07 #4
Denburt
1,356 Expert 1GB
These error messages that you are referring to usually have a button that says debug if you hit that what line of code turns yellow?
I will guess that you may have mis typed something or there may be another issue altogether. When I read your last post I noticed that it contained the following line:
Expand|Select|Wrap|Line Numbers
  1. Me!subformname[imgPicture]
Should read:
Expand|Select|Wrap|Line Numbers
  1. Me!subformname.form![imgPicture]
This may or may not be the problem let us know.
May 16 '07 #5
imrosie
222 100+
These error messages that you are referring to usually have a button that says debug if you hit that what line of code turns yellow?
I will guess that you may have mis typed something or there may be another issue altogether. When I read your last post I noticed that it contained the following line:
Expand|Select|Wrap|Line Numbers
  1. Me!subformname[imgPicture]
Should read:
Expand|Select|Wrap|Line Numbers
  1. Me!subformname.form![imgPicture]
This may or may not be the problem let us know.
Thanks so much.....you were right. I changed it to your suggestion and 438 went away. I appreciate that. sorry for delay in getting back....I was pulled away to many meetings yesterday.

take care
May 17 '07 #6
Denburt
1,356 Expert 1GB
Glad I could be of help let us know if you have any further questions.
May 17 '07 #7

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

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...
6
by: MLH | last post by:
"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...
2
by: PW | last post by:
Hi, What the heck is that supposed to mean? I am getting this error on a "Me.Requery" line in a subroutine on a form, but only when I select something from a combo/dropdown box. The *exact*...
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,...
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...
4
kcdoell
by: kcdoell | last post by:
Hello: I have the following afterupdate event: Private Sub GWP_AfterUpdate() 'Updates the Total calculation in the control "SumGWP" on the quick reference 'table that is located on the form...
2
by: zufie | last post by:
I have an Option GROUP which produces 6 different report between two dates. A separate Option BUTTON determines the period of the report once I enter the From & To Dates into the textboxes. I...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.