Hi All
I have a form consisting of a Tab control with 4 tabs. Each tab has a subform control displaying one page of a multi-page form. I need to synchronise each page of the form so that when I tab from page to page, each page displays the same record.
I have the form working correctly for existing records. I can open the form, select any existing record and view it across the 4 tabs with no problem. I can use the navigation buttons to move to any other existing record and the forms will correctly display that record. So far, no problem.
However, if I add a new record, the forms will not synchronise. I add a new record, select a primary key value from a combo box list and use the after update event to save/requery the form. But the other forms will not synchronise until after I close the form and re-open.
Can anyone suggest a way to synchronise the new record across the 4 tabs?
************************************************
This is the code to save/requery the new record
*************************************************
This code passes the PK value from the subform to the parent form
***********************************************
This code passes the PK value to the next subform to synchronise the record.
***************************************************
I'm obviously missing something in the After update code, but what?
Any suggestions would be greatly appreciated!
TIA
Lightning
I have a form consisting of a Tab control with 4 tabs. Each tab has a subform control displaying one page of a multi-page form. I need to synchronise each page of the form so that when I tab from page to page, each page displays the same record.
I have the form working correctly for existing records. I can open the form, select any existing record and view it across the 4 tabs with no problem. I can use the navigation buttons to move to any other existing record and the forms will correctly display that record. So far, no problem.
However, if I add a new record, the forms will not synchronise. I add a new record, select a primary key value from a combo box list and use the after update event to save/requery the form. But the other forms will not synchronise until after I close the form and re-open.
Can anyone suggest a way to synchronise the new record across the 4 tabs?
************************************************
This is the code to save/requery the new record
Code:
Private Sub Office_AfterUpdate()
Dim lngRecordNum As Long
lngRecordNum = Me.CurrentRecord
Me.Requery
DoCmd.GoToRecord , , acGoTo, lngRecordNum
Call Form_Current
End Sub
*************************************************
This code passes the PK value from the subform to the parent form
Code:
Private Sub Form_Current()
strCond = Office
'Set the textbox txtOffice to the Office value
Parent.SetFocus
Parent.txtOffice = strCond
End Sub
***********************************************
This code passes the PK value to the next subform to synchronise the record.
Code:
Private Sub subfrmControlledAccessOffice_Enter()
Call pgeOffice_Click
Me!subfrmStateOffice!Office.SetFocus
If Me!subfrmStateOffice!Office = "<<Select from Droplist>>" Then
Exit Sub
Else
DoCmd.FindRecord txtOffice, , , acSearchAll, , acCurrent
End If
End Sub
I'm obviously missing something in the After update code, but what?
Any suggestions would be greatly appreciated!
TIA
Lightning