Help with subform getting focus

jbandarovsky

New member
Local time
Today, 04:59
Joined
Mar 20, 2003
Messages
6
I have a form with a subform (datasheet view). The subform is controlled by a combo box (whatever the combo box selection, subform records vary accordingly). I would like that whenever the subform get the focus, it would point to its first record. What is happening is that when the subform gets the focus, it is pointing to the last record it was pointing before loosing the focus.
 
Try using GotoRecord as an event (module) on the OnFocus.

Would go something like

docmd.GoToRecord,,acFirst

HTH
 
Mark, unfortunately, it didn´t work. Do you have any other idea?
Thank you !
 
On OnFocus, try requerying the form, ie me.requery.

This will usually return the recordset to the beginning.
 
Mark,
Thanks once again for your reply, but it still doesn´t work. Every time the subform get the focus it is pointing to the same record number (even if with different data once i change the combo box data) that it was pointing when it last lost focus. If ercord number for current query is past EOF, then it ponts to the last available record number. I don´t know what else to try !
 
Unfortunatly, neither do I! These are the two methods that I normally use.

Post a sample and I'll have a look for you.
 

Users who are viewing this thread

Back
Top Bottom