T
tariss via AccessMonster.com
I have a main form with a tab control on it. The first tab has a record navigation control at the bottom. When I use the control to move to the next record I see the form fields change accordingly. On the second tab I have a subform which displays records in datasheet view based on an ID from the record in the first tab.
The problem is that the subform is also used as a stand-alone form so I'm using a procedure to force the subform requery rather than having it linked directly to the main-form. I make a call to the procedure in the subform from the mainform OnCurrent event. This all works fine. In the procedure I have the following line to get the unique key for the record displayed on the mainform
nPatientID = Me.Parent.Recordset("PatientID")
unfortunately the PatientID that is returned is not the one that corresponds to the record displayed on the mainform, but rather the previous record that was displayed. I can navigate forward and backward with the nav buttons on the mainform and the value returned with the above call is ALWAYS that of the previous record.
I'm sure I'm just not understanding something about how the recordset navigation works.
Any help would be much appreciated.
thanks
tariss
The problem is that the subform is also used as a stand-alone form so I'm using a procedure to force the subform requery rather than having it linked directly to the main-form. I make a call to the procedure in the subform from the mainform OnCurrent event. This all works fine. In the procedure I have the following line to get the unique key for the record displayed on the mainform
nPatientID = Me.Parent.Recordset("PatientID")
unfortunately the PatientID that is returned is not the one that corresponds to the record displayed on the mainform, but rather the previous record that was displayed. I can navigate forward and backward with the nav buttons on the mainform and the value returned with the above call is ALWAYS that of the previous record.
I'm sure I'm just not understanding something about how the recordset navigation works.
Any help would be much appreciated.
thanks
tariss