aleeis aleeis - 16 days ago 4 Question

Auto-select fields in ms access hyperlinks

Hello I have a table in access with colums:

ID - Autonumber
Username - Text
Display Name - Text
Auto - Hyperlink

I want to make the autofield like and be able to click it in the datasheet view.

Also will be possible in the same time that I click on the hyperlink, to copy into the clipboard the Display Name field of that row?


You can either

  1. Use a Calculated field in your table (instead of a hyperlink field). Set up the formula as ="" & Username then on your form, when you bind that column to a text box set Format > Display as hyperlink = "Always".

  2. Leave your table as is but in your form add another textbox and set the Control Source to ="" & Username and same Display as Hyperlink setting as above.

Then, which ever of those you chose (though I favor the second), on the On Click event of your textbox you have

FollowHyperlink me.textBoxWithURL
ClipBoard_SetData UserName

That ClipBoard_SetData call is from the windows API. Microsoft provides all the example code for using the API. Just copy/past into a blank module and use ClipBoard_SetData as needed.