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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set focus to row clicked in subform 1

Status
Not open for further replies.

cfvcf

Technical User
Nov 8, 2007
77
US
I have a form with a subform. In the subform code on a click event of one of the fields, I have code that grabs the ID of that row and then opens a detail form for that record. But when you click on that field, the record selector is still pointing to the first row in the subform so it opens the detail form for the first record. I tried setting focus to the field before using the code to open the detail form for it's id and it said I cannot set focus to that field. However if I click the record selector for the correct row then click on the field, it opens for the correct record.

How do you make sure the when you click on a field in a different row that row becomes the active row?

Thanks!
 
what does the uses click? Is it enabled. You cannot set the focus to a control that is not enabled. Put a command button in the line that says detail or similar icon and place your code in the on click event.

.....
I'd rather be surfing
 
Did you not already ask this?

.....
I'd rather be surfing
 
Yes I did, but I missed the enabled for this app. I didn't want the button and I was confused why this app didn't work and the other did - just missed the enabled property. Sorry for your time but thanks for your help.
 
How are ya cfvcf . . .

The field in question needs to be [blue]bound![/blue]

What you describe indicates [purple]unbound[/purple] . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top