Combo-box question

A

Amit

Windows XP, MS Access 2K
=========================
Hi,

I have a combo-box on my form to select an Organization
name (and OrgID). In the combo-box, I would like to
display all the Organization names in the table tblOrg,
plus an option "Other", without adding the value "Other"
in tblOrg. This means I'll also have to add a special
OrgID for "Other" (maybe '-1'?) just in the query for the
combo-box. I'm storing the OrgID selected through the
combo-box in another table.

Is this possible? If yes, then how can I do this?

The reason is that I'm using the combo-box with the
Organization names in many forms, and there is one
instance when the "Other" option is needed, but rest of
the forms are fine without it. And, I don't want to add a
record in the Organization table for "Other". Hope this
makes sense.

Thanks!

-Amit
 
G

Graham R Seach

Amit,

SELECT OrgID, Organization
FROM tblOrg
UNION
SELECT -1 As OrgID, "<Other>" As Organization
FROM MSysObjects WHERE [Name] = "Forms"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
A

Amit

Hi Graham,

Thanks for your response. Yes, the Union query worked like
a charm!!

Cheers,

-Amit
-----Original Message-----
Amit,

SELECT OrgID, Organization
FROM tblOrg
UNION
SELECT -1 As OrgID, "<Other>" As Organization
FROM MSysObjects WHERE [Name] = "Forms"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Windows XP, MS Access 2K
=========================
Hi,

I have a combo-box on my form to select an Organization
name (and OrgID). In the combo-box, I would like to
display all the Organization names in the table tblOrg,
plus an option "Other", without adding the value "Other"
in tblOrg. This means I'll also have to add a special
OrgID for "Other" (maybe '-1'?) just in the query for the
combo-box. I'm storing the OrgID selected through the
combo-box in another table.

Is this possible? If yes, then how can I do this?

The reason is that I'm using the combo-box with the
Organization names in many forms, and there is one
instance when the "Other" option is needed, but rest of
the forms are fine without it. And, I don't want to add a
record in the Organization table for "Other". Hope this
makes sense.

Thanks!

-Amit


.
 

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

Top