Referencing Info Indirectly..

Klion

Registered User.
Local time
Today, 06:53
Joined
Jul 12, 2004
Messages
16
I have a record with two columns. One is FieldName, the other is RealName. I know the RealName, is there a syntax I can use to reference the FieldName from RealName?

Eg.
FieldName RealName

Employer Student's Employer


I know the RealName. How do I reference the info under FieldName using the fact that I know the RealName?

Basically I need to make this work
Code:
strSQL = "SELECT DISTINCT " & Me!cboFieldName1 & " FROM " & cboTable & ";"

The problem is that Me!cboFieldName1 has to be the FieldName. Me!cboFieldName! is the RealName the user has chosen. So they have chosen "Student's Employer", but I need the code to use "Employer". Hoping there is a simple way to do this..

Thanks,

-Klion
 
You can set these in the combo box "cboFieldName1":-


Row Source: SELECT FieldName, RealName FROM yourTable

Column Count: 2

Column Widths: 0";1.6" (so that the user can only see the second column RealName)

Bound Column: 1 (so that the first column FieldName is returned by the combo box)
.
 
Thanks thats perfect. Hate it when I'm looking for solution in the wrong area :/
 

Users who are viewing this thread

Back
Top Bottom