"FOR EACH" to an Access database

maupo

New Member
Hi,

I'm connected to a database in MS Access.
The problem is that there is a table without a primarykey and when I try to use the "FOR EACH", it doesn't advance right through the records.

As an example, let's say that three fields of the table "Consumos" (this is the one with the problem) are: "Contador", "Material", "Peso"

Let's say I do something like this:
FOR EACH Consumos WHERE Consumos.Contador = 6541
AND Consumos.Material = 5 NO-LOCK:
DISPLAY Consumos.Peso.
END.



Progress displays this:
45.74
45.74
(The same value twice)

I know there are two diferent records with the same "Contador" (6541) and the same "Material" (5), but they have different "Peso".
It's like Progress also knows that there are two records, but only access the first that it founds and can't get the second one :(

I think the problem is the missing of a primary index.

I'll appreciate any idea you give me.


Thanks in advance.

I apologize for any errors in my writing, this is not my native language. :cool:
 
Top