Greetings,
I am trying to populate a hidden field (txtHiddenRepName) on an Access form when another field (cboLoanRep) is clicked. The following query is what populates the combo box:
SELECT DISTINCT Members.LastName & ", " & Members.FirstName AS Fullname, Members.RepName, Members.HoldForPayroll, Members.EmpStatus, Members.BranchNo
FROM Members
WHERE (((Members.RepName) Is Not Null) AND ((Members.HoldForPayroll)=False) AND ((Members.EmpStatus)="Active") AND ((Members.BranchNo)=[forms].[dataentry].[branchcode]))
ORDER BY Members.LastName & ", " & Members.FirstName;
The results of the combo box display Lastname, Firstname (which is what I want). What I would like to display in the hidden text field after the user makes a choice in the combo box, however, is "RepName" (the second field listed in the SELECT statement above). I have tried setting the control source of "txtHiddenRepName" to the field in the query (i.e., "[qryLoanRep]![RepName]"), but I receive a "#Name?" error. Any suggestions on how to obtain the value in the "RepName" field after the combo box is clicked? I'm at a loss of what to try next.
Thanks in advance!
I am trying to populate a hidden field (txtHiddenRepName) on an Access form when another field (cboLoanRep) is clicked. The following query is what populates the combo box:
SELECT DISTINCT Members.LastName & ", " & Members.FirstName AS Fullname, Members.RepName, Members.HoldForPayroll, Members.EmpStatus, Members.BranchNo
FROM Members
WHERE (((Members.RepName) Is Not Null) AND ((Members.HoldForPayroll)=False) AND ((Members.EmpStatus)="Active") AND ((Members.BranchNo)=[forms].[dataentry].[branchcode]))
ORDER BY Members.LastName & ", " & Members.FirstName;
The results of the combo box display Lastname, Firstname (which is what I want). What I would like to display in the hidden text field after the user makes a choice in the combo box, however, is "RepName" (the second field listed in the SELECT statement above). I have tried setting the control source of "txtHiddenRepName" to the field in the query (i.e., "[qryLoanRep]![RepName]"), but I receive a "#Name?" error. Any suggestions on how to obtain the value in the "RepName" field after the combo box is clicked? I'm at a loss of what to try next.
Thanks in advance!