Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Changing Hyperlink to Text

Status
Not open for further replies.

kieranplatt1

Programmer
Jan 21, 2004
17
GB
I have been storing email addresses as a hyperlink in a table, but Access will not sort this into order. So as I do not need the hyperlink I changed the data type back to text but now all the email addresses appear like this format...
abc@drabc.freeserve.co.uk#
Is there any easy way of getting rid of the # and everything after it on 30000 records? Can anyone help please?
 
kieranplatt1

I did not completely test this, but I was able to assign the hyperlink to a text string.

This suggests you could use a loop to read through the table and assign the link to a text field. You would of course have to define the new field for the table.

Something along the lines of...

Code:
Dim rst as DAO.RecordSet, dbs as DAO.Database

Set dbs = currentdb()
set rst = dbs.OpenRecordSet("YourTableName")

with rst
    .movefirst
    while not .eof
        .edit
        !YourNewTextField = !YourHyperLinkField
        .update
        .movenext
    loop
end with

rst.close
dbs.close

Richard
 
I must have fodder for brains.

You should be able to use an update query too...

UPDATE YourTable SET YourNewTextField = YourHyperLinkField;

A lot faster, and since this is a one shot deal, no need to save any code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top