I can't seem to fathom the quotes. I even went to Minty's link.
Code:DCount("[strField1]","Table1","[StrField2]='" & [StrField2] & "' AND [StrField3]='" & [StrField3] & "' And [StrField1]='String' & " And ID < " & [ID]+1)
I can't seem to fathom the quotes. I even went to Minty's link.
Code:DCount("[strField1]","Table1","[StrField2]='" & [StrField2] & "' AND [StrField3]='" & [StrField3] & "' And [StrField1]='String' & " And ID < " & [ID]+1)
Try
Code:DCount("[strField1]","Table1","[StrField2]='" & [StrField2] & "' AND [StrField3]='" & [StrField3] & "' And [StrField1]='String' And ID < " & [ID]+1)
pbaldy,
I get an error when I run this:
It runs the query fine and errors out when it goes to write to the table.Code:UPDATE Data SET Table1.NumSeq = DCount("[strField1]","Table1","[StrField2]='" & [StrField2] & "' AND [StrField3]='" & [StrField3] & "' And [StrField1]='String' And ID < " & [ID]+1) WHERE (((Data.[Row Type])="string"));
Error:
MS Access didn't update # fields due to a type conversion failure, 0 record(s) due to key violations,0 record(s) due to lock violations, and0 record(s) due to validation rule violations.
table1.StrField1 = Short Text
table1.StrField2 = Short Text
table1.StrField3 = Short Text
table1.NumSeq = Number
I made a smaller testdb:
I know there is numerical sequence only in one of the fields, but this is how it gets exported from elsewhere and imported to mine. It still serves its purpose to uniquely identify the record.
You had a space in the Platform_id field name. Try
UPDATE Table1 SET Table1.NumSeq = DCount("[Row Type]","Table1","[Platform_id]='" & [Platform_id] & "' AND [Role / FE / Node Name]='" & [Role / FE / Node Name] & "' And [Row Type]='MEQUIP' And ID < " & [ID]+1)
WHERE (((Table1.[Row Type])="MEQUIP"));
We haven't broken you of the spaces and symbols by now?
Thanks pbaldy, That did the trick. I think I had my eyes crossed running through this so many times, and missing a blank space every time....
Appreciate it.
No problem!