update access field value automatically

G

Guest

I am using an update.asp query to put data into my access 2003 table. ok so
far all working. I would like one of the fields in the Access table (field
name = "link" - a hyperlink field) to have a value inserted automatically,
using to the primary key value and a bit of text i.e.
"http://www.mysite.com/primarykeyvalue" whenever a record is entered. Dont
know if this is possible. Thankyou
 
R

Rick Brandt

Mick said:
I am using an update.asp query to put data into my access 2003 table. ok so
far all working. I would like one of the fields in the Access table (field
name = "link" - a hyperlink field) to have a value inserted automatically,
using to the primary key value and a bit of text i.e.
"http://www.mysite.com/primarykeyvalue" whenever a record is entered. Dont
know if this is possible. Thankyou

Only if you modify your update query to insert that value. Access/Jet has no
triggers that you can use for this like most server database engines do.
Additionally, depending on where you need to use this field it is more than
likely not required at all. Fields that are derived from other fields (almost)
always represent incorrect table design.

Since you are using a hyperlink data type you might actually "need" the field
because you require that it perform as a link, but in Access it is so easy to
get that functionality from plain old text strings that you might be able to do
without it.
 
G

Guest

Hi Rick thanks for the reply, as you have rightly assumed, I am quite new to
all this and may well have a design fault with the table,
The current update query is as it really is the resultant of a bit of text
and a field value that forms the value of Table1.photopickup .

UPDATE Table1 SET Table1.photopickup = "http://www.mysite.com/photos/" & [ID];

Which I need to run after each record is added, otherwise I need to type it
all into the field.
If there is another way of doing this automatically when the table is
closed I would appreciate a helping hand

kind regards
Mick
 
R

Rick Brandt

Mick said:
Hi Rick thanks for the reply, as you have rightly assumed, I am quite new to
all this and may well have a design fault with the table,
The current update query is as it really is the resultant of a bit of text
and a field value that forms the value of Table1.photopickup .

UPDATE Table1 SET Table1.photopickup = "http://www.mysite.com/photos/" & [ID];

Which I need to run after each record is added, otherwise I need to type it
all into the field.
If there is another way of doing this automatically when the table is
closed I would appreciate a helping hand

I am not familiar with doing stuff from asp so I can't be much help there. I
can say though that if you need that field (still an open question) then you can
run your update query whenever you want. Only you know what other events might
be appropriate to run it from.

In all my years of using Access I have never once used a hyperlink field which
is why I question whether you really need it or not. In what context is that
field being used?
 
G

Guest

Hi again Rick, sorry to be such a newbie here! I think this is the first time
for me on the Discussion group, where an answer, of "do you need it?" has
meant a total rethink of what I am trying to achieve. You are right, no I
dont need it, I have done now it without duplicating fields and text. Thanks
for provoking my thought process, all solved. Many thank Mick


Rick Brandt said:
Mick said:
Hi Rick thanks for the reply, as you have rightly assumed, I am quite new to
all this and may well have a design fault with the table,
The current update query is as it really is the resultant of a bit of text
and a field value that forms the value of Table1.photopickup .

UPDATE Table1 SET Table1.photopickup = "http://www.mysite.com/photos/" & [ID];

Which I need to run after each record is added, otherwise I need to type it
all into the field.
If there is another way of doing this automatically when the table is
closed I would appreciate a helping hand

I am not familiar with doing stuff from asp so I can't be much help there. I
can say though that if you need that field (still an open question) then you can
run your update query whenever you want. Only you know what other events might
be appropriate to run it from.

In all my years of using Access I have never once used a hyperlink field which
is why I question whether you really need it or not. In what context is that
field being used?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top