Unbound Textbox To Recordset (Vice Versa) (1 Viewer)

calvinle

Registered User.
Local time
Yesterday, 19:50
Joined
Sep 26, 2014
Messages
332
Hi,

Can anyone guide me how to have the function of a splitform to a "mainform and subform"?
I have a main form "frm_main", and a subform "tbl_main" in continuous form which is linked to the table "tbl_main".

I want to be able to click on the record, then the infor will appear in textbox on the main form. I also want to be able to change the value in the textbox and on after update, it will update that record on the subform as well.

So far, in the frm_main Current, I have added the code:
Code:
Private Sub Form_Current()
Form_frm_main.lblClient = Me.client_id
End Sub

So now, what code should I add to the After update of the textbox to find the current selected to update back the value of the textbox to the selected record?

Thanks.
 

winshent

Registered User.
Local time
Today, 03:50
Joined
Mar 3, 2008
Messages
162
Firstly rename the subform control as 'frm_Main_Sub'..

To do this, put the main form in design mode and right click on the subform to go to properties. Set the name of the subform object in the 'Others' tab.

To refesh you need some code like this

Code:
Forms!frm_Main!frmMain_Sub.Requery
 

Users who are viewing this thread

Top Bottom