Hyperlinks for records from subform to other form (1 Viewer)

evictme

Registered User.
Local time
Today, 04:32
Joined
May 18, 2011
Messages
168
Hello all,

I have a form that has a subform in it controlled by one of the categories (Client List that can has a supervisor dropdown that controls the subform). I want to turn the "Customer" field into a hyperlink that when clicked will open up the "Customer Form" displaying the respective customer.

Ive been trying to develop a search feature for a few forms but have had no success making the things i have found work the way i need them too or at all so thought this might be my best bet.

Can anyone help? does anyone have an idea of what i mean?

thanks in advance!

- Evictme
 
Local time
Today, 19:32
Joined
Aug 8, 2010
Messages
245
A hyperlink is not the best thing to use here. Usually we would use either a button ( can be at the far left or far right of each row of the subform), or we would use the double click event of the text boxes in the subform. You could also use just a single button in the header of the subform instead of a button on each row of the subform.

The code on the click event of the button or the double click of the textbox would be something like:
DoCmd.OpenForm "[FormName]", , , "[PrimaryKeyName] = " & Me.[ID]

Replace my field/control names with your own.

For help with building a search form, here is a link to my favorite and often used search template.

http://www.allenbrowne.com/ser-62.html
 

evictme

Registered User.
Local time
Today, 04:32
Joined
May 18, 2011
Messages
168
Hi Jeanette,

Thank you so much for your help, I think im going with the double click event procedure but I am not great with the expression builder coding. Would you be able to provide a sample that is a little more broken down?

thanks for pointing me to the search form, I think im going to use it on top of the double click event.
 
Local time
Today, 19:32
Joined
Aug 8, 2010
Messages
245
I will need some more information before I can do that.

- What is the name of the primary key field in the subform where user will do the double click. Is it a long integer or a text field?

- What is the name of the primary key field in the form that user will open by doing the double click? Is it a long integer or a text field?
 

evictme

Registered User.
Local time
Today, 04:32
Joined
May 18, 2011
Messages
168
1. ClientID - long integer
2. Same as above

subform name =ClientList
Form to display info=Clients

Thanks.
 
Local time
Today, 19:32
Joined
Aug 8, 2010
Messages
245
The button on the subform will have code like this:

DoCmd.OpenForm "Clients", , , "ClientID = " & Me.ClientID
 

evictme

Registered User.
Local time
Today, 04:32
Joined
May 18, 2011
Messages
168
Thank you for all your help Jeanette.
 

Users who are viewing this thread

Top Bottom