I would like to autopopulate and display data on some fields of FormB when the user presses btnAddRec on Form A. The data will be coming from FormA. I have added code below on the OnLoad event of FormB but it does not work. I only want these fields to be autopopulated when it's a new record. Thanks.
.
Code:
Private Sub Form_Load()
txtRelatedTo.SetFocus
If IsNull([txtRelatedTo]) Then
Me![txtRelatedTo] = Forms![frmTaskDetail]![TaskID]
End If
cboSTPriorityNum.SetFocus
if IsNull([cboSTPriorityNUm]) Then
Me![cboSTPriorityNum] = Forms![frmTaskDetail]![Text6]
End Sub