By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Query parameter with a combo box

P: n/a
Hi,

How do you reference a combo box first column in a query as a
parameter?
For example, in MyQuery in Name column, I want to put down as a
parameter from the first column of a combo box in the login form, like
this:

Name

[Forms]![frmLogin]![cboUsername].Column(1)

In the combo box: column (0) is the ID number, column (1) is the
name.

It doesn't work.

Thank you for your attention.

Pauline
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 13 Apr 2004 15:50:49 -0700, Pauline Liu wrote:
Hi,

How do you reference a combo box first column in a query as a
parameter?
For example, in MyQuery in Name column, I want to put down as a
parameter from the first column of a combo box in the login form, like
this:

Name

[Forms]![frmLogin]![cboUsername].Column(1)

In the combo box: column (0) is the ID number, column (1) is the
name.

It doesn't work.

Thank you for your attention.

Pauline


Don't use the [Name] field to find records use the [NameID] field.

Add the [NameID] field to the query. Then use
[Forms]![frmLogin]![cboUsername]
as criteria in the [NameID] column.

The actual [Name] field will display the name while the [NameID] is
used to find the records.

I hope you do not have a field actually named "Name".
"Name" is a reserved key word in Access/VBA and should not be used as
a field name.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.