multiple stLinkCriteria help

flying linus

Registered User.
Local time
Today, 07:28
Joined
Oct 1, 2004
Messages
33
I have a table that lists single failures, I then run an append query to create a table of dual failures of every combo of the single failures. I am trying to create a form that lists only the dual failures associated with a particular failure and here is the criteria I have below:

stLinkCriteria = "[1st_Fail_ID]=" & "'" & Me![Failure_ID] & "'" And "[2nd_Fail_ID]=" & "'" & Me![Failure_ID] & "'"


All field in the above statement are text fields.
I keep getting a type mismatch error. I am not an access developer and learning on my own, so any help will be appreciated.
 
What is the data type of 1st_Fail_ID in the table (number or text).

Also, you haven't included the "AND" within the quotes as it needs to be.

However, if you have a table with each failure, it shouldn't be necessary to create a new table with the second failure. You could just count the occurances. What is the structure of your main table?
 
Oops, I missed that you said they were text fields. Try this:

stLinkCriteria = "[1st_Fail_ID]='" & Me![Failure_ID] & "' And [2nd_Fail_ID]='" & Me![Failure_ID] & "'"

I'd still like to do without the second table if possible.
 
The second table contains data specific to the dual failure condition.
 
pbaldy...

I tried your code and generated no errors, however, no data is returned.

The second table has the following structure...
DF_ID - text field
1st_Fail_ID - text field based on Failure_ID of the original table
2nd_Fail_ID - text field based on Failure_ID of the orginal table
and supporting data...
I broke out the 1st and 2nd Fail IDs for sorting and filtering purposes and probably broke the every db law in the book. In the form, I am only showing the DF_ID and some supporting data, but want to filter based on the original Failure_ID.
 
I was asking about the structure of the first table, because I'm not sure you need the second at all. If you can attach a small sample db, I can show you what I mean (or fix the problem you have).
 
First table is as follows...

Domain - text, combo box
Failure_ID - text
Failure_description - text
Other-supportign data that makes each record unique...
Failure_rate - Number

In the Dual Failure table, the failure rates are calculated....
If you have any ideas on if I shoudl change the structure of my db, please share.

Can't share sample db...

Thanks
 

Users who are viewing this thread

Back
Top Bottom