By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,426 Members | 3,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,426 IT Pros & Developers. It's quick & easy.

Can I use the data in one field as a variable in the other?

P: n/a
Hi,

I got a bit of problem with Access and was wondering if someone could
enlighten me.

I'm building a database of products of sale, complete with images. Im
importing the product data from a CSV file into an access databse. The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.

Basically, I want to copy the record entry for 'ProductID' as a
variable into its associated 'ImagPath' field.

eg: I have product ID 12345. I want to copy the value '12345' and use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'

Can this be done easily in Access?

Cheers...John

Jul 18 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Yes.

if expressing the path on a form it might be expressed as:

"\images\" & me.productIDfieldname & ".jpg"

In general that is how it will be. Now if it is a true number then it
depends on how the name of the jpg file was created vs how it is
stored. (Was the name for the picture related to product 10 created as
10.jpg or as 0000010.jpg? If it is a longer name then the reference
will probably be:

"\images\" & format(me.productIDfieldname, "0000000") & ".jpg"
Ron

Jul 18 '06 #2

P: n/a
"\images\" & [ProdID] & ".jpg"

But why store the image path when you can calculate it whenever needed?
<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I got a bit of problem with Access and was wondering if someone could
enlighten me.

I'm building a database of products of sale, complete with images. Im
importing the product data from a CSV file into an access databse. The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.

Basically, I want to copy the record entry for 'ProductID' as a
variable into its associated 'ImagPath' field.

eg: I have product ID 12345. I want to copy the value '12345' and use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'

Can this be done easily in Access?

Cheers...John

Jul 18 '06 #3

P: n/a
How would I do that Ron?

Thanks....John

paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"

But why store the image path when you can calculate it whenever needed?
<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I got a bit of problem with Access and was wondering if someone could
enlighten me.

I'm building a database of products of sale, complete with images. Im
importing the product data from a CSV file into an access databse. The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.

Basically, I want to copy the record entry for 'ProductID' as a
variable into its associated 'ImagPath' field.

eg: I have product ID 12345. I want to copy the value '12345' and use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'

Can this be done easily in Access?

Cheers...John
Jul 19 '06 #4

P: n/a
Replace Me![ImagePath] with "\images\" & Me![ProdID] & ".jpg" whenever you
need to display the image.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How would I do that Ron?

Thanks....John

paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"

But why store the image path when you can calculate it whenever needed?
<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,
>
I got a bit of problem with Access and was wondering if someone could
enlighten me.
>
I'm building a database of products of sale, complete with images. Im
importing the product data from a CSV file into an access databse.
The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.
>
Basically, I want to copy the record entry for 'ProductID' as a
variable into its associated 'ImagPath' field.
>
eg: I have product ID 12345. I want to copy the value '12345' and use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'
>
Can this be done easily in Access?
>
Cheers...John
>

Jul 19 '06 #5

P: n/a
Sorry I dont understand - what does the Me mean or do?

paii, Ron wrote:
Replace Me![ImagePath] with "\images\" & Me![ProdID] & ".jpg" whenever you
need to display the image.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How would I do that Ron?

Thanks....John

paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"
>
But why store the image path when you can calculate it whenever needed?
>
>
<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I got a bit of problem with Access and was wondering if someone could
enlighten me.

I'm building a database of products of sale, complete with images. Im
importing the product data from a CSV file into an access databse.
The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.

Basically, I want to copy the record entry for 'ProductID' as a
variable into its associated 'ImagPath' field.

eg: I have product ID 12345. I want to copy the value '12345' and use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'

Can this be done easily in Access?

Cheers...John
Jul 19 '06 #6

P: n/a
Inside an event procedure, ME is the current form or report. I was assuming
you were storing the image path to display it on a form or report, or to
open it with a button click on a form. Me![ProdID] will return the value of
the ProdID control on the form containing the command button you just
clicked.

<jo***********@yahoo.co.ukwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Sorry I dont understand - what does the Me mean or do?

paii, Ron wrote:
Replace Me![ImagePath] with "\images\" & Me![ProdID] & ".jpg" whenever
you
need to display the image.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How would I do that Ron?
>
Thanks....John
>
paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"

But why store the image path when you can calculate it whenever
needed?


<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,
>
I got a bit of problem with Access and was wondering if someone
could
enlighten me.
>
I'm building a database of products of sale, complete with images.
Im
importing the product data from a CSV file into an access databse.
The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.
>
Basically, I want to copy the record entry for 'ProductID' as a
variable into its associated 'ImagPath' field.
>
eg: I have product ID 12345. I want to copy the value '12345' and
use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'
>
Can this be done easily in Access?
>
Cheers...John
>
>

Jul 19 '06 #7

P: n/a
No, Im using the path to point an image file on a dynamic web page that
Im generating from the database.

What view do I need to be using to insert the value '& [ProdID]' & by
the way? Im in datasheet view and have pasted the above in but
nothing seems to have happened.

Thanks...John

paii, Ron wrote:
Inside an event procedure, ME is the current form or report. I was assuming
you were storing the image path to display it on a form or report, or to
open it with a button click on a form. Me![ProdID] will return the value of
the ProdID control on the form containing the command button you just
clicked.

<jo***********@yahoo.co.ukwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Sorry I dont understand - what does the Me mean or do?

paii, Ron wrote:
Replace Me![ImagePath] with "\images\" & Me![ProdID] & ".jpg" whenever
you
need to display the image.
>
<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How would I do that Ron?

Thanks....John

paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"
>
But why store the image path when you can calculate it whenever
needed?
>
>
<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I got a bit of problem with Access and was wondering if someone
could
enlighten me.

I'm building a database of products of sale, complete with images.
Im
importing the product data from a CSV file into an access databse.
The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.

Basically, I want to copy the record entry for 'ProductID' as a
variable into its associated 'ImagPath' field.

eg: I have product ID 12345. I want to copy the value '12345' and
use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'

Can this be done easily in Access?

Cheers...John
Jul 21 '06 #8

P: n/a
In the "Control Source" of the [ImagePath] control enter

="\images\" & [ProdID] & ".jpg"

Note "Me" is not used in the Control Source. You could otherwise calculate
the path in the source query to the form.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
No, Im using the path to point an image file on a dynamic web page that
Im generating from the database.

What view do I need to be using to insert the value '& [ProdID]' & by
the way? Im in datasheet view and have pasted the above in but
nothing seems to have happened.

Thanks...John

paii, Ron wrote:
Inside an event procedure, ME is the current form or report. I was
assuming
you were storing the image path to display it on a form or report, or to
open it with a button click on a form. Me![ProdID] will return the value
of
the ProdID control on the form containing the command button you just
clicked.

<jo***********@yahoo.co.ukwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Sorry I dont understand - what does the Me mean or do?
>
paii, Ron wrote:
Replace Me![ImagePath] with "\images\" & Me![ProdID] & ".jpg"
whenever
you
need to display the image.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How would I do that Ron?
>
Thanks....John
>
paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"

But why store the image path when you can calculate it whenever
needed?


<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,
>
I got a bit of problem with Access and was wondering if
someone
could
enlighten me.
>
I'm building a database of products of sale, complete with
images.
Im
importing the product data from a CSV file into an access
databse.
The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.
>
Basically, I want to copy the record entry for 'ProductID' as
a
variable into its associated 'ImagPath' field.
>
eg: I have product ID 12345. I want to copy the value '12345'
and
use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'
>
Can this be done easily in Access?
>
Cheers...John
>
>
>

Jul 21 '06 #9

P: n/a
Sorry Im being a bit of a thicko here, but how do i enter the "Control
Source" view.

Also, to get this to work, should I be creating a new query and
selecting the table?

Thanks again.

paii, Ron wrote:
In the "Control Source" of the [ImagePath] control enter

="\images\" & [ProdID] & ".jpg"

Note "Me" is not used in the Control Source. You could otherwise calculate
the path in the source query to the form.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
No, Im using the path to point an image file on a dynamic web page that
Im generating from the database.

What view do I need to be using to insert the value '& [ProdID]' & by
the way? Im in datasheet view and have pasted the above in but
nothing seems to have happened.

Thanks...John

paii, Ron wrote:
Inside an event procedure, ME is the current form or report. I was
assuming
you were storing the image path to display it on a form or report, or to
open it with a button click on a form. Me![ProdID] will return the value
of
the ProdID control on the form containing the command button you just
clicked.
>
<jo***********@yahoo.co.ukwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Sorry I dont understand - what does the Me mean or do?

paii, Ron wrote:
Replace Me![ImagePath] with "\images\" & Me![ProdID] & ".jpg"
whenever
you
need to display the image.
>
<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How would I do that Ron?

Thanks....John

paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"
>
But why store the image path when you can calculate it whenever
needed?
>
>
<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I got a bit of problem with Access and was wondering if
someone
could
enlighten me.

I'm building a database of products of sale, complete with
images.
Im
importing the product data from a CSV file into an access
databse.
The
two main fields Im concerned with are called 'ProductID' and
'ImagePath'.

Basically, I want to copy the record entry for 'ProductID' as
a
variable into its associated 'ImagPath' field.

eg: I have product ID 12345. I want to copy the value '12345'
and
use
it to form the full image path in the 'ImagePath' field ie.
'\images\(var).jpg'

Can this be done easily in Access?

Cheers...John

Jul 21 '06 #10

P: n/a

<jo***********@yahoo.co.ukwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Sorry Im being a bit of a thicko here, but how do i enter the "Control
Source" view.
Open the form in design mode, right click on the control, select properties,
scroll down to "Control Source"

Also, to get this to work, should I be creating a new query and
selecting the table?
You can calculate the [ImagePath] in the source query to your form and
control, or use your existing query / table and edit the control source of
the [ImagePath] control.
Thanks again.

paii, Ron wrote:
In the "Control Source" of the [ImagePath] control enter

="\images\" & [ProdID] & ".jpg"

Note "Me" is not used in the Control Source. You could otherwise
calculate
the path in the source query to the form.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
No, Im using the path to point an image file on a dynamic web page
that
Im generating from the database.
>
What view do I need to be using to insert the value '& [ProdID]' & by
the way? Im in datasheet view and have pasted the above in but
nothing seems to have happened.
>
Thanks...John
>
paii, Ron wrote:
Inside an event procedure, ME is the current form or report. I was
assuming
you were storing the image path to display it on a form or report,
or to
open it with a button click on a form. Me![ProdID] will return the
value
of
the ProdID control on the form containing the command button you
just
clicked.

<jo***********@yahoo.co.ukwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Sorry I dont understand - what does the Me mean or do?
>
paii, Ron wrote:
Replace Me![ImagePath] with "\images\" & Me![ProdID] & ".jpg"
whenever
you
need to display the image.

<jo***********@yahoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
How would I do that Ron?
>
Thanks....John
>
paii, Ron wrote:
"\images\" & [ProdID] & ".jpg"

But why store the image path when you can calculate it
whenever
needed?


<jo***********@yahoo.co.ukwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,
>
I got a bit of problem with Access and was wondering if
someone
could
enlighten me.
>
I'm building a database of products of sale, complete with
images.
Im
importing the product data from a CSV file into an access
databse.
The
two main fields Im concerned with are called 'ProductID'
and
'ImagePath'.
>
Basically, I want to copy the record entry for 'ProductID'
as
a
variable into its associated 'ImagPath' field.
>
eg: I have product ID 12345. I want to copy the value
'12345'
and
use
it to form the full image path in the 'ImagePath' field
ie.
'\images\(var).jpg'
>
Can this be done easily in Access?
>
Cheers...John
>
>
>
>

Jul 21 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.