reuse combo box result

S

Song Su

I have a combo box to look for name. The row source is:

SELECT [Full_Name] & " " & [EN] AS Expr1, WSInstructor.EN
FROM WSInstructor
ORDER BY [Full_Name] & " " & [EN];

After find the record, I want to assign EN to intEN as below:

Private Sub cboLookUp_AfterUpdate()
intEN = Me!EN
intEN.SetFocus
End Sub


However, error message says "can't find the field 'EN" refered to in your
expression.

Where did I do wrong?

Thanks for help.
 
S

shanesullaway via AccessMonster.com

Hey Song Su,

Don't know if I'm quit following what your trying to do but I'll attempt to
lend a hand. If you are wanting intEN to equal what is in the combo box then
you would want to do this:

intEN = Me.ComboBoxName (if the value you want is in the first column. If
it is in any other column then you will need to indentify the column number
by adding Me.ComboBoxName.Column(ColumnNumber) Access starts numbering
columns at 0 so the second column is actually (1).

HTH
Shane

Song said:
I have a combo box to look for name. The row source is:

SELECT [Full_Name] & " " & [EN] AS Expr1, WSInstructor.EN
FROM WSInstructor
ORDER BY [Full_Name] & " " & [EN];

After find the record, I want to assign EN to intEN as below:

Private Sub cboLookUp_AfterUpdate()
intEN = Me!EN
intEN.SetFocus
End Sub

However, error message says "can't find the field 'EN" refered to in your
expression.

Where did I do wrong?

Thanks for help.
 
S

Song Su

Perfect! Works great! Thank you!

shanesullaway via AccessMonster.com said:
Hey Song Su,

Don't know if I'm quit following what your trying to do but I'll attempt
to
lend a hand. If you are wanting intEN to equal what is in the combo box
then
you would want to do this:

intEN = Me.ComboBoxName (if the value you want is in the first column.
If
it is in any other column then you will need to indentify the column
number
by adding Me.ComboBoxName.Column(ColumnNumber) Access starts numbering
columns at 0 so the second column is actually (1).

HTH
Shane

Song said:
I have a combo box to look for name. The row source is:

SELECT [Full_Name] & " " & [EN] AS Expr1, WSInstructor.EN
FROM WSInstructor
ORDER BY [Full_Name] & " " & [EN];

After find the record, I want to assign EN to intEN as below:

Private Sub cboLookUp_AfterUpdate()
intEN = Me!EN
intEN.SetFocus
End Sub

However, error message says "can't find the field 'EN" refered to in your
expression.

Where did I do wrong?

Thanks for help.
 
Top