Nancythomas
Registered User.
- Local time
- Today, 15:38
- Joined
- Apr 20, 2010
- Messages
- 59
I have two forms (FORM_B) AND a sub-form (FORM_A)
FORM_B - is a search form that provides the results as a continuous form (Example)
EmpNo Surname FirstName Department
123 Smith John Sales
423 Harry Jim Sales
563 Tom Eric Sales
I would like to pass the above information by a click of a button in FORM_B to a subform FORM_A.
I want to load the above information from FORM_B to a subform FORM_A
I can pass a single row but I am unable to load all the three rows automatically by a button click.
My Event script is as follows:
Private Sub cmdOpenFORM_A_Click()
Me.Refresh
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FORM_A"
stLinkCriteria = "[EmpNo]=" & Me![EmpNo]
[Forms]![frmEmails]![FORM_A]![EmpNo] = Me![EmpNo]
[Forms]![frmEmails]![FORM_A]![EmpNo] ![txtFirstName] = Me![FirstName]
[Forms]![frmEmails]![FORM_A]![EmpNo] ![txtSurname] = Me![Surname]
[Forms]![frmEmails]![FORM_A]![EmpNo] ![txtDepartment] = Me![DivDescription]
DoCmd.Close
End Sub
-----
My FORM_A has the same fields as a continuous form:
EmpNo Surname FirstName Department
Please help
FORM_B - is a search form that provides the results as a continuous form (Example)
EmpNo Surname FirstName Department
123 Smith John Sales
423 Harry Jim Sales
563 Tom Eric Sales
I would like to pass the above information by a click of a button in FORM_B to a subform FORM_A.
I want to load the above information from FORM_B to a subform FORM_A
I can pass a single row but I am unable to load all the three rows automatically by a button click.
My Event script is as follows:
Private Sub cmdOpenFORM_A_Click()
Me.Refresh
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FORM_A"
stLinkCriteria = "[EmpNo]=" & Me![EmpNo]
[Forms]![frmEmails]![FORM_A]![EmpNo] = Me![EmpNo]
[Forms]![frmEmails]![FORM_A]![EmpNo] ![txtFirstName] = Me![FirstName]
[Forms]![frmEmails]![FORM_A]![EmpNo] ![txtSurname] = Me![Surname]
[Forms]![frmEmails]![FORM_A]![EmpNo] ![txtDepartment] = Me![DivDescription]
DoCmd.Close
End Sub
-----
My FORM_A has the same fields as a continuous form:
EmpNo Surname FirstName Department
Please help