PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

[Access 2000] Images on Form

 
 
croy
Guest
Posts: n/a
 
      19th Sep 2010
I've been trying to get an Image Frame working, but am
having troubles.

The form is a single form. I'd like the picture for each
photo record to appear in the Image Frame as the user moves
thru the pictures.

My photo.mdb has a table for photo information, and that has
a field for "path".

I made another table just to hold a single record in a
single field for "Drive Letter".

My thought was... a user could start the db and the
starting form would ask them to pick a drive letter from the
cbo list. That gets stored in the table ok.

In the Current event, I've been trying to get the syntax
right for adding the drive letter to the path, but haven't
figured it out after many hours of "try this".

Can anyone help?

Thanks,
croy
 
Reply With Quote
 
 
 
 
David W. Fenton
Guest
Posts: n/a
 
      19th Sep 2010
croy <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> I've been trying to get an Image Frame working, but am
> having troubles.


Version of Access makes a really big difference here, as recent
versions have improved image controls.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
croy
Guest
Posts: n/a
 
      20th Sep 2010
On 19 Sep 2010 20:48:44 GMT, "David W. Fenton"
<(E-Mail Removed)> wrote:

>croy <(E-Mail Removed)> wrote in
>news:(E-Mail Removed):
>
>> I've been trying to get an Image Frame working, but am
>> having troubles.

>
>Version of Access makes a really big difference here, as recent
>versions have improved image controls.


Access 2000 (9.0).
 
Reply With Quote
 
Access Developer
Guest
Posts: n/a
 
      20th Sep 2010
"croy" <(E-Mail Removed)> wrote

> I've been trying to get an Image Frame
> working, but am having troubles.
>
> The form is a single form. I'd like the
> picture for each photo record to appear
> in the Image Frame as the user moves
> thru the pictures.
>
> My photo.mdb has a table for photo
> information, and that has a field for "path".
>
> I made another table just to hold a single record in a
> single field for "Drive Letter".
>
> My thought was... a user could start the db and the
> starting form would ask them to pick a drive letter from the
> cbo list. That gets stored in the table ok.
>
> In the Current event, I've been trying to get the syntax
> right for adding the drive letter to the path, but haven't
> figured it out after many hours of "try this".


I'm a little confused as to what you want, but I think it boils down to
this:

1. You have a path stored as a string (example:
":/somefolder/somesubfolder/")
2. You will store a drive letter (example: "d")
3. You wish to prepend the drive letter to the path (and end up with
example "d:/somefolder/somesubfolder")

The following function will do that: pass it the path, and the drive letter.
Of course you can do this directly in your own VBA code. I tested in the
function for the minimum possible meaningful length of the path and for the
drive letter being exactly one -- I included no additional validity
checking, but you may wish to do so. Note: it doesn't matter to this
function whether the path includes filename and extension, or whether you
will append that later.

Function PrependDrive(strPath As String, strDrive As String) As String
If Len(strPath) > 1 And Len(strDrive) = 1 Then
PrependDrive = strDrive & strPath
Else
PrependDrive = "Invalid Input"
End If
End Function

and some executions from the Immediate Window:

? PrependDrive (":/some/file.ext","f")
f:/some/file.ext
? PrependDrive (":/","f")
f:/
? PrependDrive (":","r")
Invalid Input
? PrependDrive (":/some/other/","rx")
Invalid Input

But that seems to me to be far too simple an operation to be giving you
trouble.

If I have misunderstood what you need, please post back here and someone
(maybe even I) will likely be able to suggest a solution.

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access




 
Reply With Quote
 
croy
Guest
Posts: n/a
 
      20th Sep 2010
On Sun, 19 Sep 2010 23:21:36 -0500, "Access Developer"
<(E-Mail Removed)> wrote:

>"croy" <(E-Mail Removed)> wrote
>
> > I've been trying to get an Image Frame
> > working, but am having troubles.
> >
> > The form is a single form. I'd like the
> > picture for each photo record to appear
> > in the Image Frame as the user moves
> > thru the pictures.
> >
> > My photo.mdb has a table for photo
> > information, and that has a field for "path".
> >
> > I made another table just to hold a single record in a
> > single field for "Drive Letter".
> >
> > My thought was... a user could start the db and the
> > starting form would ask them to pick a drive letter from the
> > cbo list. That gets stored in the table ok.
> >
> > In the Current event, I've been trying to get the syntax
> > right for adding the drive letter to the path, but haven't
> > figured it out after many hours of "try this".

>
>I'm a little confused as to what you want, but I think it boils down to
>this:
>
> 1. You have a path stored as a string (example:
>":/somefolder/somesubfolder/")
> 2. You will store a drive letter (example: "d")
> 3. You wish to prepend the drive letter to the path (and end up with
>example "d:/somefolder/somesubfolder")
>
>The following function will do that: pass it the path, and the drive letter.
>Of course you can do this directly in your own VBA code. I tested in the
>function for the minimum possible meaningful length of the path and for the
>drive letter being exactly one -- I included no additional validity
>checking, but you may wish to do so. Note: it doesn't matter to this
>function whether the path includes filename and extension, or whether you
>will append that later.
>
>Function PrependDrive(strPath As String, strDrive As String) As String
> If Len(strPath) > 1 And Len(strDrive) = 1 Then
> PrependDrive = strDrive & strPath
> Else
> PrependDrive = "Invalid Input"
> End If
> End Function
>
>and some executions from the Immediate Window:
>
> ? PrependDrive (":/some/file.ext","f")
> f:/some/file.ext
> ? PrependDrive (":/","f")
> f:/
> ? PrependDrive (":","r")
> Invalid Input
> ? PrependDrive (":/some/other/","rx")
> Invalid Input
>
>But that seems to me to be far too simple an operation to be giving you
>trouble.
>
>If I have misunderstood what you need, please post back here and someone
>(maybe even I) will likely be able to suggest a solution.
>
> --
> Larry Linson, Microsoft Office Access MVP
> Co-author: "Microsoft Access Small Business Solutions", published by Wiley
> Access newsgroup support is alive and well in USENET
>comp.databases.ms-access


Thanks for your reply.

It sounds like you understand my need correctly. But your
approach is different than what I was trying to do.

I was trying to put code like this into the form's Current
event:

Dim PathInfo As String
PathInfo = [tblDriveLtr].[DriveLtr] & Me![PhotoPath]

Me![ImageFrame].Picture = Me![txtFilePath]

Now you probably get a better picture of where my skill
level falls.... ;-l

--
croy
 
Reply With Quote
 
croy
Guest
Posts: n/a
 
      20th Sep 2010
On Mon, 20 Sep 2010 10:24:49 -0700, croy
<(E-Mail Removed)> wrote:

>On Sun, 19 Sep 2010 23:21:36 -0500, "Access Developer"
><(E-Mail Removed)> wrote:
>
>>"croy" <(E-Mail Removed)> wrote
>>
>> > I've been trying to get an Image Frame
>> > working, but am having troubles.
>> >
>> > The form is a single form. I'd like the
>> > picture for each photo record to appear
>> > in the Image Frame as the user moves
>> > thru the pictures.
>> >
>> > My photo.mdb has a table for photo
>> > information, and that has a field for "path".
>> >
>> > I made another table just to hold a single record in a
>> > single field for "Drive Letter".
>> >
>> > My thought was... a user could start the db and the
>> > starting form would ask them to pick a drive letter from the
>> > cbo list. That gets stored in the table ok.
>> >
>> > In the Current event, I've been trying to get the syntax
>> > right for adding the drive letter to the path, but haven't
>> > figured it out after many hours of "try this".

>>
>>I'm a little confused as to what you want, but I think it boils down to
>>this:
>>
>> 1. You have a path stored as a string (example:
>>":/somefolder/somesubfolder/")
>> 2. You will store a drive letter (example: "d")
>> 3. You wish to prepend the drive letter to the path (and end up with
>>example "d:/somefolder/somesubfolder")
>>
>>The following function will do that: pass it the path, and the drive letter.
>>Of course you can do this directly in your own VBA code. I tested in the
>>function for the minimum possible meaningful length of the path and for the
>>drive letter being exactly one -- I included no additional validity
>>checking, but you may wish to do so. Note: it doesn't matter to this
>>function whether the path includes filename and extension, or whether you
>>will append that later.
>>
>>Function PrependDrive(strPath As String, strDrive As String) As String
>> If Len(strPath) > 1 And Len(strDrive) = 1 Then
>> PrependDrive = strDrive & strPath
>> Else
>> PrependDrive = "Invalid Input"
>> End If
>> End Function
>>
>>and some executions from the Immediate Window:
>>
>> ? PrependDrive (":/some/file.ext","f")
>> f:/some/file.ext
>> ? PrependDrive (":/","f")
>> f:/
>> ? PrependDrive (":","r")
>> Invalid Input
>> ? PrependDrive (":/some/other/","rx")
>> Invalid Input
>>
>>But that seems to me to be far too simple an operation to be giving you
>>trouble.
>>
>>If I have misunderstood what you need, please post back here and someone
>>(maybe even I) will likely be able to suggest a solution.
>>
>> --
>> Larry Linson, Microsoft Office Access MVP
>> Co-author: "Microsoft Access Small Business Solutions", published by Wiley
>> Access newsgroup support is alive and well in USENET
>>comp.databases.ms-access

>
>Thanks for your reply.
>
>It sounds like you understand my need correctly. But your
>approach is different than what I was trying to do.
>
>I was trying to put code like this into the form's Current
>event:
>
> Dim PathInfo As String
> PathInfo = [tblDriveLtr].[DriveLtr] & Me![PhotoPath]
>
> Me![ImageFrame].Picture = Me![txtFilePath]
>
>Now you probably get a better picture of where my skill
>level falls.... ;-l


Woops!

That should have been:

Dim PathInfo As String
PathInfo = [tblDriveLtr].[DriveLtr] & Me![PhotoPath]

Me![ImageFrame].Picture = PathInfo

--
croy
 
Reply With Quote
 
Access Developer
Guest
Posts: n/a
 
      21st Sep 2010
That is not the correct way to access a field in a table in Access VBA code.

You can use DLookup or open a Recordset on the table. Even better, you can
access the single record of the single field of the table in your startup
code and save the drive letter.

If you store it in a Public Variable, it may be lost in case an error
occurs, so you may want to create a Property into which to store it, or just
look it up each time you use it, or retrieve it with a DLookup only if the
Public Variable is empty.

My guess is that using the DLookup in your VBA statement will not noticeably
deteriorate performance, and it would be the simplest approach. I think
there is good Help on DLookup in all versions of Access, but if you have
problems, keep posting.

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access


"croy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Mon, 20 Sep 2010 10:24:49 -0700, croy
> <(E-Mail Removed)> wrote:
>
>>On Sun, 19 Sep 2010 23:21:36 -0500, "Access Developer"
>><(E-Mail Removed)> wrote:
>>
>>>"croy" <(E-Mail Removed)> wrote
>>>
>>> > I've been trying to get an Image Frame
>>> > working, but am having troubles.
>>> >
>>> > The form is a single form. I'd like the
>>> > picture for each photo record to appear
>>> > in the Image Frame as the user moves
>>> > thru the pictures.
>>> >
>>> > My photo.mdb has a table for photo
>>> > information, and that has a field for "path".
>>> >
>>> > I made another table just to hold a single record in a
>>> > single field for "Drive Letter".
>>> >
>>> > My thought was... a user could start the db and the
>>> > starting form would ask them to pick a drive letter from the
>>> > cbo list. That gets stored in the table ok.
>>> >
>>> > In the Current event, I've been trying to get the syntax
>>> > right for adding the drive letter to the path, but haven't
>>> > figured it out after many hours of "try this".
>>>
>>>I'm a little confused as to what you want, but I think it boils down to
>>>this:
>>>
>>> 1. You have a path stored as a string (example:
>>>":/somefolder/somesubfolder/")
>>> 2. You will store a drive letter (example: "d")
>>> 3. You wish to prepend the drive letter to the path (and end up with
>>>example "d:/somefolder/somesubfolder")
>>>
>>>The following function will do that: pass it the path, and the drive
>>>letter.
>>>Of course you can do this directly in your own VBA code. I tested in the
>>>function for the minimum possible meaningful length of the path and for
>>>the
>>>drive letter being exactly one -- I included no additional validity
>>>checking, but you may wish to do so. Note: it doesn't matter to this
>>>function whether the path includes filename and extension, or whether you
>>>will append that later.
>>>
>>>Function PrependDrive(strPath As String, strDrive As String) As String
>>> If Len(strPath) > 1 And Len(strDrive) = 1 Then
>>> PrependDrive = strDrive & strPath
>>> Else
>>> PrependDrive = "Invalid Input"
>>> End If
>>> End Function
>>>
>>>and some executions from the Immediate Window:
>>>
>>> ? PrependDrive (":/some/file.ext","f")
>>> f:/some/file.ext
>>> ? PrependDrive (":/","f")
>>> f:/
>>> ? PrependDrive (":","r")
>>> Invalid Input
>>> ? PrependDrive (":/some/other/","rx")
>>> Invalid Input
>>>
>>>But that seems to me to be far too simple an operation to be giving you
>>>trouble.
>>>
>>>If I have misunderstood what you need, please post back here and someone
>>>(maybe even I) will likely be able to suggest a solution.
>>>
>>> --
>>> Larry Linson, Microsoft Office Access MVP
>>> Co-author: "Microsoft Access Small Business Solutions", published by
>>> Wiley
>>> Access newsgroup support is alive and well in USENET
>>>comp.databases.ms-access

>>
>>Thanks for your reply.
>>
>>It sounds like you understand my need correctly. But your
>>approach is different than what I was trying to do.
>>
>>I was trying to put code like this into the form's Current
>>event:
>>
>> Dim PathInfo As String
>> PathInfo = [tblDriveLtr].[DriveLtr] & Me![PhotoPath]
>>
>> Me![ImageFrame].Picture = Me![txtFilePath]
>>
>>Now you probably get a better picture of where my skill
>>level falls.... ;-l

>
> Woops!
>
> That should have been:
>
> Dim PathInfo As String
> PathInfo = [tblDriveLtr].[DriveLtr] & Me![PhotoPath]
>
> Me![ImageFrame].Picture = PathInfo
>
> --
> croy



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Access 2000 form with images =?Utf-8?B?V2lsbGllX1dhcnRob2c=?= Microsoft Access Forms 0 22nd Mar 2007 09:07 PM
Using images in Access 2000 =?Utf-8?B?THVrZSBCeXJuZQ==?= Microsoft Access 1 22nd Jul 2006 12:19 AM
Upload/Saving Images from ASP.NET Form to SQL Server 2000 Lars Netzel Microsoft ASP .NET 1 2nd Aug 2005 03:55 PM
Re: BMP Images in Access 2000 Larry Linson Microsoft Access 1 14th Sep 2004 02:33 PM
Access 2000 Forms and JPG images Frank Microsoft Access Forms 1 24th Sep 2003 11:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 PM.