473,463 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cannot assign value to OLE Unbound Frame in Form_Current Event

4
Hi There,

I am using Access 2003 on Windows XP. I cannot execute this code in any of the form's Open, Load, Activate, Current event.

It gives me the folowing error: The setting you entered isn't valid for this property.

The form does contain a subform, but removing it makes no difference.

Expand|Select|Wrap|Line Numbers
  1.  
  2.      If IsNull(Me![SketchImage]) Then
  3.         If cmdLoadSketch.Enabled = False Then cmdLoadSketch.Enabled = True
  4.         cmdLoadSketch.Visible = True
  5.         oleSketch.SourceDoc = sPicPath & "\Placeholder.bmp" ' Ignored
  6.     Else
  7.         On Error GoTo Found_Err
  8.         With oleSketch
  9.             .Enabled = True
  10.             .Locked = False
  11.             sPicPath = Me![SketchImage].Value ' This is /<path>/Picture.bmp
  12.             .OLETypeAllowed = acOLELinked
  13.             .Class = "Paint.Picture"
  14.             .SourceDoc = sPicPath   ' This line gives error
  15.            .Action = acOLECreateLink
  16.         End With
  17.     End If
Me![SketchImage] is a text field in a linked table.

Can anyone please help. We need to be able to store the path to object in the database and then change the contents of the of the form and/or report dynamically at runtime.
Aug 23 '07 #1
7 3738
Rabbit
12,516 Expert Mod 8TB
You said the error is 'The setting you entered isn't valid for this property'

But which setting is it talking about? Which property is it talking about?
Aug 23 '07 #2
pctron
4
You said the error is 'The setting you entered isn't valid for this property'

But which setting is it talking about? Which property is it talking about?
Hi Thanks for reply.

See line 13 in the code snippet above

The property is the SourceDoc property on this line in the code snippet
.SourceDoc = sPicPath ' This line gives error

I am trying to move the code to another location to see if that works.
Aug 24 '07 #3
Rabbit
12,516 Expert Mod 8TB
What's oleSketch?

The error message means that there's no property called SourceDoc for that object. This could mean that there really is no property called SourceDoc or that you're missing a reference.
Aug 24 '07 #4
pctron
4
What's oleSketch?

The error message means that there's no property called SourceDoc for that object. This could mean that there really is no property called SourceDoc or that you're missing a reference.
Thanks Rabbit for replying.

I cannot assign a properly formed filepath value to the OLE Unbound Frame (oleSketch ) in the form's Form_Current Event. I use the same code in a command button to load or reload the original picture and then it works. The problem is not that the code does not work. The problem is that it does not work where I want it to work (i.e. automatically).

I just would like to state that I have many years of programming experience including MS Access, so its unlikely I would make silly mistakes.

Thanks
Aug 27 '07 #5
pctron
4
What's oleSketch?

The error message means that there's no property called SourceDoc for that object. This could mean that there really is no property called SourceDoc or that you're missing a reference.
Thanks Rabbit for replying.

I cannot assign a properly formed filepath value to the OLE Unbound Frame (oleSketch ) in the form's Form_Current Event. I use the same code in a command button to load or reload the original picture and then it works. The problem is not that the code does not work. The problem is that it does not work where I want it to work (i.e. automatically).

The problem is that the path of the file as stored in the database was wrong. I did not check for the existence of the file. I confess, I am capable of making silly mistakes.

Thanks
Aug 27 '07 #6
Rabbit
12,516 Expert Mod 8TB
No worries, I don't think there's anyone that never makes a silly mistake.
Aug 27 '07 #7
NeoPa
32,556 Expert Mod 16PB
...
I just would like to state that I have many years of programming experience including MS Access, so its unlikely I would make silly mistakes.

Thanks
I saw this and immediately thought "but I'm quite experienced too and I make silly mistakes from time to time".
It appears you learned quite quickly from yours ;)
This is not meant unkindly. It's hard to express how much of the subject you understand (to the person trying to help).
Aug 28 '07 #8

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

Similar topics

8
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
2
by: Chino | last post by:
Hi guys, Sorry but i am new to ASP.Net and C# so please bear with my pleb questions. I have the following in a C# class which is being inherited by my ASP.Net page. In this class i have an...
1
by: sfindlay | last post by:
I have two comboboxes in an unbound field: - finds Vendor ID, and from this list finds Application ID using Vendor ID as the filter. The application details are populated in a subform bound...
2
by: Bob Darlington | last post by:
When I run the following code from a continuous form's Current event: Set ctrl = Me.ActiveControl I get an error 2474 - 'The expression you entered requires the control to be in the active...
1
by: No_Spam | last post by:
I have an MS Access form attached to a table. I have a text box which has its control source set to a field in the table... However, at run time if certain things change, I want to the change the...
6
by: Don Lancaster | last post by:
I need to progrmatically do this inside a loop this.fh03.value = fixFloat (Harms, numPoints) ; with the numbers changing per an index. If I try curHvals = "03" ; // (derived from...
8
Dököll
by: Dököll | last post by:
Hey gang! Below code allows me to search my database though all fields included on the form. Works great. Small issue, when I fetch partial phrases, if they contain an apostrophy, say, "Ferris...
1
by: tapich | last post by:
Hello Developers, I have this strange runtime exception coming up for an application that has been running fine from 10 years. There is a label(txtlabel) on a report (Report_cell1)in my Access Db;...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.