473,840 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display an image using an expression?

Novice Access programmer here.

I would like to display an image using the Toolbox Image object by
calling the images file name using:

=fPictureFiles([Forms]![frmPatients]![cboTitleofCourt esy],1)

in the Picture control.

Below is the function which DOES actually returns a valid file
location such as:

c:\Pictures\pic 01.jpg

The Picture control seems to only accept an actual file location and
not an expression.

What am I missing?

Thanks in advance to all you pro's.
Here's the Function, which when tested in the Immediate Window works
perfectly:

Function fPictureFiles(s trDir As String, lngPictureNumbe r As Long) As
String

Dim fs As Object

Set fs = Application.Fil eSearch
With fs
.LookIn = strDir
.FileName = "*.*"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Cou nt
If i = lngPictureNumbe r Then
fPictureFiles = .FoundFiles(i)
End If
Next i
Else
MsgBox "There were no files found."

End If
End With

Set fs = Nothing

End Function
Nov 13 '05 #1
1 2691
Sorry for the error. I messed up my function call on the original
post. This is the function call I want to put in the Picture control
to call my image to the image box on the form.

=fPictureFiles([Forms]![frmPatients]![tboPictureDirec tory],1)

The tboPictureDirec tory displays a table field holding the location of
the patients pictures and comes from a form that calls the picture
form to display pictures. The 1 shown above signifies the first file
in the folder is to be displayed in this image box.

bb*******@gmail .com (bborden) wrote in message news:<ea******* *************** ****@posting.go ogle.com>...
Novice Access programmer here.

I would like to display an image using the Toolbox Image object by
calling the images file name using:

=fPictureFiles([Forms]![frmPatients]![cboTitleofCourt esy],1)

in the Picture control.

Below is the function which DOES actually returns a valid file
location such as:

c:\Pictures\pic 01.jpg

The Picture control seems to only accept an actual file location and
not an expression.

What am I missing?

Thanks in advance to all you pro's.
Here's the Function, which when tested in the Immediate Window works
perfectly:

Function fPictureFiles(s trDir As String, lngPictureNumbe r As Long) As
String

Dim fs As Object

Set fs = Application.Fil eSearch
With fs
.LookIn = strDir
.FileName = "*.*"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Cou nt
If i = lngPictureNumbe r Then
fPictureFiles = .FoundFiles(i)
End If
Next i
Else
MsgBox "There were no files found."

End If
End With

Set fs = Nothing

End Function

Nov 13 '05 #2

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

Similar topics

8
12208
by: Yves PEYSSON | last post by:
Hi, I want to display the same image (from the same file) at different positions in a window. Up to now I used DIV command in the body part of the text, and document.getElementById in order to place it at the right place. But when I do that several times, only the last position is displayed. How to show all positions ? Thanks Yves
9
1966
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual Basic .Net application. I have researched MSDN for help and found the example article 321900 (see below) and set up a test and everything works fine when I use SQL Server 2000 but when I modify the code and use data from Access 2000 using an...
4
8391
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to display the contents of a TIFF image file. According to the very limited documentation that I have been able to locate so far, all I should need to do is to drop the Image Edit Control onto the form in design mode, set the control's Image property to...
5
10640
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into the dataset because I don't know what datatype to set the dataset column and then set this image to. I saw an example where someone defended a datatable in the global class and defined the column as an object, however, when I define a strongly...
5
5052
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page that calls the web service to render a vertical strip of images. After doing some research I am unable to find some vb.net code that can assist in what I want to achieve. The closest thing I found was
3
14950
by: Bama | last post by:
I already stored the image in the SQL database. How do I retrieve it? Any help is appreciated.
9
2605
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
1
3534
by: nanaalwi | last post by:
Hi, Currently I'm developing a software using VB.net that can grab an image using Matrox Morphis card and display it in a PictureBox. The software can grab the image already and display it in the form (Imports Matrox.ActiveMil). But the problem is I need to display the image in the PictureBox but I don't know how. The coding to grab the image is as follows: ActiveMILApplication = CreateObject("MIL.Application")
3
2850
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net app, in the page there is a scan activex which could scan and save a jpg file in client harddisk. How could we access and display this jpg file on the fly using js in the client IE? Thanks, -Billy zhang
0
9699
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10660
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10301
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9440
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7838
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4498
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 we have to send another system
2
4076
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.