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

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

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
10 1580
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
"\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
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
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
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
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
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
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
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

<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
4
by: Chuck Anderson | last post by:
I've read some discussions, searched Google, tried pack, unpack, bin2hex, explode, implode, and I just can't figure out how to convert this data. I am trying to read a file with the following...
3
by: 'bonehead | last post by:
Greetings, I'd like to figure out some syntax for retrieving the data from a table when I don't know all the of field names. What I do know are, the name of the table, the names of the primary...
7
by: Jack | last post by:
Hi, I have posted this problem before. Apprently, the suggestion took care of the problem. However, still I am getting the above error message. I am using a session variable to transfer a value...
0
by: Ken Allen | last post by:
I am relatively new to C# and .Net in general, but have been programming in many other languages for more years than I want to recall. I have a problem where an existing set of code (actually a...
8
by: Mark | last post by:
Hello. I am attempting to write binary data from a file to an OLE Object field, and then write the file back out from the database. I am reading and writing the files in binary mode, and using...
14
by: Manish | last post by:
The project I am developing doesn't involves database. I want to parse the mailbox file (.mbx) and store the summary in the text file for fast retrieval and display of information in the Inbox...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
4
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.