Requery continues forms problem

TJBernard

Registered User.
Local time
Today, 09:24
Joined
Mar 28, 2002
Messages
176
I have a continous subform, that once a drop down box is choose from, the subfrom needs to be requeried CODE:

Me.Requery

This works just fine, except the requery automatically sets the focus back to the 1st record. So if the users enters like 20 records into the subform, and they are scrolled down, and they choose from the drop down list, everything saves correctly, but they are thrown back to the first record.

Is there anyway around this?

Thank you,

T.J.
 
When you reset the subform filter, what record do you want displayed. The purpose of selecting a new combobox value (using your methology) is to select a new set of subform records. Again, what record do you want to be positioned to?

Use a subform recordsetclone to position to whatever subform record you want, but after the requery.
 
Requery continous subform

Thank you so much for replying. I would like to try the subform recordsetclone, but I am not sure of the exact code. I will play with the code, but if you get a chance could you give an example of the correct code?

The purpose of the requery is to update the current record only. Once the user selects from the drop down I just need the current record requeried, but was not sure how to program that. I need the focus set back to the same record that was being updated. If this is possible with the subform recordsetclone then let me know.

Thank you again for your help,

TJBernard
 
'criteria to find the subform record your want
sWhere ="PropID=" & me!PropID ' for a long number
sWhere = "sProp='" & me!sProp & "'" for a string
etc.
forms!frmMain!subfrmMain.Form.RecordsetClone.findfirst sWhere
if forms!frmMain!subfrmMain.Form.RecordsetClone.NoMATCH Then
'error message, didn't find it
goto Exit_Code
end if

forms!frmMain!subfrmMain.Form.Bookmark = _
forms!frmMain!subfrmMain.Form.RecordsetClone.Bookmark
 

Users who are viewing this thread

Back
Top Bottom