Building a list box based on field value

J

Jeff Stewart

I'm trying to setup a field in my table so that its contents changes based
on the value of a field in the same record.

Specifically, I have a table detailing IT work that has been performed on
various computers called "IT Completed". One field in this table is
"Computer", the computer on which the work was performed, and this field is
a key into another table listing all the computers in our organization by
AutoNumber.

Another field in IT Completed, "Software", describes what software was
tinkered with during the IT work. It should be a list box that, when
opened, displays all the software installed on the computer selected in the
"Computer" field. To facilitate this, I've created a separate table,
"Installed Software", that catalogs what software is installed on what
computer by associating an application name with a computer number.

It seems like all I should have to do is build a query in my IT Completed
table for the Software field's Row Source. That query would lookup two
fields: [Installed Software].Computer and [Installed Software].Application.
The criteria for the [Installed Software].Computer field should be [IT
Completed].Computer, meaning my criteria for [Installed Software].Computer
is the value of [IT Completed].Computer in the record being edited.

But I can't figure out how to make this work; Access won't let me refer to
IT Completed while IT Completed is open.

The only thing I could find in Access Help that might explain how to get a
query to refer to the table/record in which it lives:
"You can create in a table a Lookup field that displays values from the
same table. For example, in the Employees table, you can display the name of
each employee's supervisor in the ReportsTo field - a Lookup field that
displays data from the FirstName and LastName fields by looking up the
corresponding EmployeeID."

If that's the same thing I'm trying to do, I can't figure out how to do it!
 
J

John Nurick

Hi Jeff,

If I understand what you want correctly, you can't do it in a table. Use
a form. In the form's Current event, adjust the RowSource of the listbox
or combobox displaying the Software list according to the value in the
Computer field.


I'm trying to setup a field in my table so that its contents changes based
on the value of a field in the same record.

Specifically, I have a table detailing IT work that has been performed on
various computers called "IT Completed". One field in this table is
"Computer", the computer on which the work was performed, and this field is
a key into another table listing all the computers in our organization by
AutoNumber.

Another field in IT Completed, "Software", describes what software was
tinkered with during the IT work. It should be a list box that, when
opened, displays all the software installed on the computer selected in the
"Computer" field. To facilitate this, I've created a separate table,
"Installed Software", that catalogs what software is installed on what
computer by associating an application name with a computer number.

It seems like all I should have to do is build a query in my IT Completed
table for the Software field's Row Source. That query would lookup two
fields: [Installed Software].Computer and [Installed Software].Application.
The criteria for the [Installed Software].Computer field should be [IT
Completed].Computer, meaning my criteria for [Installed Software].Computer
is the value of [IT Completed].Computer in the record being edited.

But I can't figure out how to make this work; Access won't let me refer to
IT Completed while IT Completed is open.

The only thing I could find in Access Help that might explain how to get a
query to refer to the table/record in which it lives:
"You can create in a table a Lookup field that displays values from the
same table. For example, in the Employees table, you can display the name of
each employee's supervisor in the ReportsTo field - a Lookup field that
displays data from the FirstName and LastName fields by looking up the
corresponding EmployeeID."

If that's the same thing I'm trying to do, I can't figure out how to do it!
 
J

Jeff Stewart

That sounds reasonable. I'm so used to entering data manually that the idea
of a form never occured to me.

Thanks, John.

--
Jeff S.


John Nurick said:
Hi Jeff,

If I understand what you want correctly, you can't do it in a table. Use
a form. In the form's Current event, adjust the RowSource of the listbox
or combobox displaying the Software list according to the value in the
Computer field.


I'm trying to setup a field in my table so that its contents changes based
on the value of a field in the same record.

Specifically, I have a table detailing IT work that has been performed on
various computers called "IT Completed". One field in this table is
"Computer", the computer on which the work was performed, and this field is
a key into another table listing all the computers in our organization by
AutoNumber.

Another field in IT Completed, "Software", describes what software was
tinkered with during the IT work. It should be a list box that, when
opened, displays all the software installed on the computer selected in the
"Computer" field. To facilitate this, I've created a separate table,
"Installed Software", that catalogs what software is installed on what
computer by associating an application name with a computer number.

It seems like all I should have to do is build a query in my IT Completed
table for the Software field's Row Source. That query would lookup two
fields: [Installed Software].Computer and [Installed Software].Application.
The criteria for the [Installed Software].Computer field should be [IT
Completed].Computer, meaning my criteria for [Installed Software].Computer
is the value of [IT Completed].Computer in the record being edited.

But I can't figure out how to make this work; Access won't let me refer to
IT Completed while IT Completed is open.

The only thing I could find in Access Help that might explain how to get a
query to refer to the table/record in which it lives:
"You can create in a table a Lookup field that displays values from the
same table. For example, in the Employees table, you can display the name of
each employee's supervisor in the ReportsTo field - a Lookup field that
displays data from the FirstName and LastName fields by looking up the
corresponding EmployeeID."

If that's the same thing I'm trying to do, I can't figure out how to do
it!
 

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