hello all!
My issue is this:
I have a main form frm_Tasks with a suform frm_TasksTracking.
Because this will be used heavily, I want to NOT force the users to click a button or 'goto' a new record, I want to the New record on the subform to auto set when the form loads, and when navigating between records on the main form.
Currently the subform is in a tab control on the main form. I tried a number of ways and put code in a number of events - the code DOES work, but I need help on getting the tab control/subform to set the new record - without forcing it to 'get focus' first.(if possible)
here is the code:
Public Sub NewTaskRec()
If TabCtl52.Value = 1 Then
Forms!frm_Tasks!frm_TaskTracking.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
End Sub
I have this in a number of areas, and it works, but if the tab control is NOT on the subform, the code won't fire. If I take out the 'if' condition, and just have the code set the focus, make the change to the subform, then go back to the original tab, it looks horrible on the screen - i.e., you can see it flashing to the tab control with the subform and flashing back
How can I get the subform on another control to 'go to a new record' every time the main record changes? maybe there is an easier master way to do this - but everything I have tried fails. Everything requires me to set the focus on this control, and if it's not there to begin with there is this flashy mess on the screen as it goes through the motions.
Please help!
Thank you!
Tina
My issue is this:
I have a main form frm_Tasks with a suform frm_TasksTracking.
Because this will be used heavily, I want to NOT force the users to click a button or 'goto' a new record, I want to the New record on the subform to auto set when the form loads, and when navigating between records on the main form.
Currently the subform is in a tab control on the main form. I tried a number of ways and put code in a number of events - the code DOES work, but I need help on getting the tab control/subform to set the new record - without forcing it to 'get focus' first.(if possible)
here is the code:
Public Sub NewTaskRec()
If TabCtl52.Value = 1 Then
Forms!frm_Tasks!frm_TaskTracking.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
End Sub
I have this in a number of areas, and it works, but if the tab control is NOT on the subform, the code won't fire. If I take out the 'if' condition, and just have the code set the focus, make the change to the subform, then go back to the original tab, it looks horrible on the screen - i.e., you can see it flashing to the tab control with the subform and flashing back
How can I get the subform on another control to 'go to a new record' every time the main record changes? maybe there is an easier master way to do this - but everything I have tried fails. Everything requires me to set the focus on this control, and if it's not there to begin with there is this flashy mess on the screen as it goes through the motions.
Please help!
Thank you!
Tina