Subform highlighting/selection problem

croydon

Registered User.
Local time
Today, 12:31
Joined
Oct 12, 2006
Messages
22
I have a form with an embedded subform with continuous forms view. The idea being that the user clicks on a row and the details are displayed in a separate form for editing. This works successfully for me, but not for some other users.
The form is not linked to the subform by master/child, but is used to change the subform filtering by updating its RecordSource.
When the users open the main form the first time, the record pointer is on the top row of the subform. If they click on any row (it does not become highlighted), the details of the top row are displayed for editing.
After this it works perfectly. This problem only occurs the first time the form is opened and they select a record.
We have the same model of laptop, we appear to have the same Access and mouse settings. I don't understand it.
Any suggestions would be appreciated.
 
it only occurs on the first opening of the main form becoz the main foem has the Focus. add code to the main form's Load event to set the focus to the subform.

Code:
private sub form_load()
me.subformNae.setfocus
me.subformName.Form!texboxname.setfocus
end sub
 
Last edited by a moderator:
arnelgp, just tried that but unfortunately the same issue.
The fact that it works differently for me and other users makes me think it must be a setting somewhere
 
Need some more info, how do you go about opening the separate form? You should use something like:
Temp.jpg

Then on the button, in the "Click" event something like:
Code:
    stLinkCriteria = "[IndexField]=" & Me![IndexField]
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , ,
(or in the field "GotFocus" event, but then it gets 'sticky,' as you need to move the focus out upon returning to the parent subform.)
 
instead of button, try using unbound textbox.
changw thw backcolor to mimic a commandbutton. you then add code to its click event.
 
it might not work with a button.

what you may try if you need a button is add an unbound tbox In front of the button. make the backstyle to transparent. still you will use the click event of the txtbox.
the reason is when you click on the button, it might not move to the correct record in the subform.
 
it might not work with a button.

what you may try if you need a button is add an unbound tbox In front of the button. make the backstyle to transparent. still you will use the click event of the txtbox.
the reason is when you click on the button, it might not move to the correct record in the subform.
I use the button method daily. Multiple subforms, from multiple tables/queries, split database, 2 front-ends (customized), 2 institutions, 2 users.
 
Last edited:
I have been able to replicate the user's problem. This only happens if the form is called from a combobox on the customised ribbon. If it is run from a button on the ribbon it works perfectly. When the combobox selection is made it goes into a subroutine containing a select case and when it finds the selection runs DoCmd.OpenForm "frmInvoiceTrackerSelection". The test using the button uses the same command.
 
it only occurs on the first opening of the main form becoz the main foem has the Focus. add code to the main form's Load event to set the focus to the subform.

Code:
private sub form_load()
me.subformNae.setfocus
me.subformName.Form!texboxname.setfocus
end sub
Hi Sir, i really don't know what to say, i was struggling for more than 2 weeks to solve this problem, but when i see your suggestion to Croydon, i say why not try it, and it works, maybe the word "thanks " is not enough to expresse my feeling to you, you are really a great teacher.
 

Users who are viewing this thread

Back
Top Bottom