Setting Focus to Continuous Form Record

esipp

Registered User.
Local time
Today, 11:21
Joined
Nov 5, 2004
Messages
29
:confused: I have a subform set to continuous forms view, allowing a user to enter multiple addresses for each parent record.

Next each address field in the subform detail, i have a hyperlink "Envelope" that I want to be able to click and print an envelope report with the address FOR THAT RECORD

The trouble is, I click and it will ALWAYS send the FIRST record in the subform unless I click in an individual text field before clicking its corresponding hyperlink.

HOW can I set focus to the record for which the hyperlink is clicked??!
 
The best way to do this is to cheat!

Create a textbox (invisible) with the ID of the record you want to print. Under this, create a label (or button for that matter) with the 'Envelope' Hyperlink on it. Ensure that the invisible textbox is on top of the buton/label In the on_click event of the invisible put the code that prints out the report but ensure that the code printing out the report has the where clause set to the ID set in your invisble textbox
 
I tried to get this to work, but if I set the "Visible" property to false, the textbox does nothing. My only other choice is to jockey the settings to make the border transparent, the text match the background color, but then the hyperlink loses its value entirely - the hand pointer does not show up, etc. Any other suggestions?
 
Yep, that is another way of hiding the value but keep the label for the textbox and make sure it sits on top of the textbox you have doctored.

Use the On_Click() event of the label to run the code behind your button
as when you click on the label it will set the focus to that record.

Unfortunately, you will not get a hand pointer, just a straightforward arrow but it should work fine.
 

Users who are viewing this thread

Back
Top Bottom