setfocus problem

ssoltic

Registered User.
Local time
Today, 17:17
Joined
Sep 1, 2004
Messages
65
I have form called frmMain with subform based on a crosstab query. Because crosstab query isn't editable I create a command button to open another form to change data, but when I go back to frmMain I call frmMain.subform.requery to refresh data. Everything is working, but how to go (setfocus) to the row (to records) where I change data (I have hundreds of rows in crosstab). :mad:
 
"the row (to records) where I change data (I have hundreds of rows in crosstab). "

elaborate what you need to see a bit more...

and I may be able to offer a solution, I am not sure I understand...
 
thanks BLeslie88 !


lets say I'm on 15th row (costumer called Denis). after I change data in another form and requery data I wont to retain focus to that 15th row (costumer called Denis).

thanks in advance
 
Having not done this before...

I am not in a position to aid you at this moment.

I know you would want to pass the stCriteria back to the main form...

Then search for a unique value in the recordset and setfocus there.

Not sure this helps at all, sorry I can't help more at this time.
 
Is this what you want?

Code:
Dim stDocName As String 
Dim stLinkCriteria As String

stDocName = "frmMain"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Forms![frmMain]![subform]![IDField].Enabled = True
Forms![frmMain]![subform]![IDField].SetFocus
DoCmd.FindRecord Me![IDField] 'The field in the subform
Forms![frmMain]![subform]![SomeOtherField].SetFocus
Forms![frmMain]![subform]![IDField].Enabled = False

Put this code in the change data form in the close event and also, change the appropriated names.
Maybe this help but not sure.

Le
 
Thanx Le

Many thanx this is what I need.

Thanx a loot.
 

Users who are viewing this thread

Back
Top Bottom