View Single Post
  #12  
Old May 9th, 2007, 07:29 PM posted to microsoft.public.access.tablesdbdesign
Access Newbee Dave[_2_]
external usenet poster
 
Posts: 13
Default Table design and relationships for cascading comboboxes

Hi Hunter57,

I entered the SQL that you mentioned and received a syntax error. I noted a
missing "[" at the beginning of the second line. I fixed it and still get the
"ENTER PARAMETER VALUE"
"Forms!Form1!Failure_Type" popup.

I am wondering if I need to go back to the basics...
Before looking at the SQL, Do I have the tables set up properly?
If the tables are set up properly do I need to provide for object
dependancies or relationships?
Do I need to set up some form of query or does the SQL provide the
appropriate capability to display only those items as categorized by the
first combo box?

Thanks again.
Dave


"Hunter57" wrote:

Hi Dave,

Before you try to make it a Parameter Query I saw something that will
definately cause a query to fail. You are using critera for a field that is
not included in your query.

This is your Criteria:
[TableFailureMode].[Type_ID]

But you do not have [TableFailureMode].[Type_ID] in the first part of your
query so Access will keep asking you for the criteria or parameter until you
take car of that.

First, make a copy of your database. (Just copy the file to another folder
or to your desktop.)

Open your database. In design view click on your Failure_Submode combo box
and then open the properties sheet. Click the Data Tab. In the RowSource
REPLACE what you have there now with the SQL below. Just copy and past it
in. Try that and let me know if that takes care of the problem.

SELECT [TableFailureMode].[Mode_ID], [TableFailureMode].[Failure_Mode],
TableFailureMode].[Type_ID]
FROM TableFailureMode
WHERE ((([TableFailureMode].[Type_ID])= [Forms]![Form1]![Failure_Mode]))
ORDER BY [TableFailureMode].[Failure_Mode];

The only difference between this and what you have been using is that
TableFailureMode].[Type_ID] has been added to the SELECT part of the
statement.

Hunter57
Just huntin' for some data.
http://churchmanagementsoftware.googlepages.com


"Access Newbee Dave" wrote:

The name at the top of the other tab in the property sheet of the combo box
I am trying to set up is "Failure_Mode". I tried to change the "WHERE"
statement as follows and still see the "ENTER PARAMETER VALUE" popup:


SELECT [TableFailureMode].[Mode_ID], [TableFailureMode].[Failure_Mode]
FROM TableFailureMode
WHERE ((([TableFailureMode].[Type_ID])= [Forms]![Form1]![Failure_Mode]))
ORDER BY [TableFailureMode].[Failure_Mode];

I am not sure what you mean by making this a parameter query. Do I use the
"Create query in design view" wizard or is this done from the design view of
the form?

Thanks

Dave


"Hunter57" wrote:

Hi Dave,

The error message suggests that there is a problem with the criteria or
parameter.

Have you checked the name of your combo box by opening the Properties sheet
of the combo box, clicking the "Other" Tab to make sure that the Name listed
there is the same as the name in the last bracket that reads Failure_Type
[Forms]![Form1]![Failure_Type] ? If the name of your combo box is Combo34 or
cboFailure_Type instead of Failure_Type that will make your query fail.

You need to make the names match by changing either the name in the brackets
or the name of the combo box.

If that is not the problem, then you may need to make this a Parameter
Query. Sometimes Access just doesn't work well with getting the creteria
from a Form. You can do this by opening your query in design view, click
Query on the Menu Bar up top, and select Parameters at the bottom of the
list. A grid like this opens up.
___________________________
|__Parameter__ |__Data Type__ |
|_____________|_____________|
|_____________|_____________|
|_____________|_____________|
|_____________|_____________|
|_____________|_____________|
|_____________|_____________|
|_____________|_____________|
|_____________|_____________|


Insert your [Forms]![Form1]![Failure_Type] in the Parameter Column and
appropriately select either Text or Long Integer in the Data Type Column.

Save your query and pray that it works!

If none of this works, try posting your request for help again in the
Queries Forum. Hopefully one of the Access MVP's (an expert) will be able to
help you.

Also, please post back here and let me know if you are able to get your
query to work.

Hunter57

"Access Newbee Dave" wrote:

Hunter57, thanks for your response. It still looks like I am stuck though.

The underscores (_) indicated below are in fact underscores in the names and
not an indication of spaces. I used no spaces in my naming conventions.
I entered the following:

SELECT [TableFailureMode].[Mode_ID], [TableFailureMode].[Failure_Mode]
FROM TableFailureMode
WHERE ((([TableFailureMode].[Type_ID])= [Forms]![Form1]![Failure_Type]))
ORDER BY [TableFailureMode].[Failure_Mode];

I now receive the following pop-up error message.

Enter Parameter Value
Forms!Form1!Failure_Type
(There is an entry field and two buttons OK and Cancel in this popup
window)


Regardless of how I close the box when I click the dropdown arrow for the
combo box I see one row with three blank fields.

Hopefully my explaination is understood. Again, thanks in advance for any
help.

Dave