Need a little help

  • Thread starter Matthew Rivenbark via AccessMonster.com
  • Start date
M

Matthew Rivenbark via AccessMonster.com

Hi,

I have created a form which has two combo boxes and three text boxes. The
first combo box lists Department names. I want the second combo box to
display a list of software names assigned to the department selected in the
first combo box. I have created a query that pulls from two tables. The
first table (SoftwareNames) has two fields the first is SoftwareID the second
is Software Name. The other table (Software) has a SoftwareID field where the
SoftwareID from the first table is stored. The query seems to work but If I
select a department that has only one Software name assiciated I get a list
containing the department selected software name and the previous
department's list also.

Anther problem I am having is when the department and software name have been
selected I want to display information pulled from another query. The
queries criterior is pulled form the above combo boxed. All I seem to be
getting is #Name? error.

Thanks,

MattR
 
A

Al Camp

Matthew,
Looks like a table design problem. You only need 1 table for software...
with SoftwareID and SoftwareName. Use this a the query source for the first
combo (ex. cboSoftwareID) Another table with just SoftwareID is unecessary
in order to form a relationship between Software and Department.
Your DepartmentSoftware table should have an appropriate SoftWareID for
each app installed.

cboSoftware should be a 2 column combo with SoftwareID in 1st column and
SoftwareName in the 2nd. Set the combo widths to 0" ; 1" and ColumnCount to
2. This will allow the user to select a SoftWare name, and display it in
the combo...
BUT... will really capture the SoftWareID in that field. Also...Requery
cboDepartment on the ASfterUpdate event of cboSoftwareID to synch them.

Now, the second combo should have 2 colums at least... Department and
SofwareID. In the query behind the combo, use this criteria against
SoftwareID (use your own names)
=Forms!frmYourFormName!cboSoftwareID
Now only those departments that have that Software should display as
choices.

Regarding your 2nd question, somewhere in your code you're referring to a
control by the wrong name, or to a control that doesn't exist. Spelling is
a primary cause. Pric * Qty would cause a Name error because of the
spelling of Price.
It's next to impossible for anyone to help on this type of problem, since
we can't see the code... and more importantly we can't see all the elements
the code may refer to. You'll have to check your code carefully and find
that element that Access can't locate.
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 

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