MySQL Forums
Forum List  »  Microsoft Access

Re: Converting Hyperlink Fields from Access to MYSQL
Posted by: Sebastien Caisse
Date: January 04, 2006 01:12PM

I'm guessing you wish to simulate a file selection dialog where the "link" would be the file you've selected, and you wish to continue to use Access as a front-end, only you're converting to MySQL as a backend...

You'll need to create a button (we'll call it cmdBrowse) first, place it somewhere relevant to the field you wish to change (we'll call it txtHyperlink).
You might want to change the button's caption to "..." (or a render of three dots, or a folder) and provide a proer controltip and/or status bar text too.

On the button, create an On Click event. Personally I used the FileDialog object since it's included on any machine on which Office is installed and most machines with Access have Office installed. To use it, go in the script editor (double click on the On Click cmdBrowse event), Tools menu -> References, find the "Microsoft Office XX.0 Object Library" and check it off.

Add code similar to this:

Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.Title = "Open file reference"
fd.AllowMultiSelect = False

If fd.Show = -1 Then
txtHyperlink = fd.SelectedItems(1)
End If

You'll also need to simulate the "hyperlink click", so you'll need to code the On Click event of txtHyperlink too with something similar to this

If not IsNull(txtHyperlink) then
Shell TxtHyperlink
End if

There can be plenty of other issues hindering the conversion though, like checking if the file exists, wether the application to open the file is installed, wether running path of the app is right and such.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Converting Hyperlink Fields from Access to MYSQL
3123
January 04, 2006 01:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.