Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a Hidden Field 1

Status
Not open for further replies.

hsp7777

Programmer
Jan 11, 2005
67
US
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!
 
= cboLoanRep.Column(1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks. I appreciate it. That works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top