reuse combo box result

  • Thread starter Thread starter Song Su
  • Start date Start date
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.
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top