R
Roderick O'Regan
Windows XP Pro - Access 2002
I have split a database and wish to delete a record from a linked
table.
The following code worked OK before the split:
===============
mySQLStr = "SELECT * FROM orders"
Set ts = db.OpenRecordset(mySQLStr, dbOpenDynaset)
pOrderValue = DMax("[PO_Nbr]", "orders")
If pOrderValue <> pcodevalue Then
With ts
.Index = "PrimaryKey"
.Seek "=", pOrderValue
.Delete
.Close
End With
End If
================
However, because it is now split the Index and Seek cannot be used. I
think, from what I've read in this newsgroup and in Help, that I might
have to create an SQL statement with a WHERE in it based on the value
as defined by 'pOrderValue' above.
I've had a number of attempts in creating this sort of statement but
it always ends in an error or won't compile.
Could someone point me in the right direction, please?
Roderick
I have split a database and wish to delete a record from a linked
table.
The following code worked OK before the split:
===============
mySQLStr = "SELECT * FROM orders"
Set ts = db.OpenRecordset(mySQLStr, dbOpenDynaset)
pOrderValue = DMax("[PO_Nbr]", "orders")
If pOrderValue <> pcodevalue Then
With ts
.Index = "PrimaryKey"
.Seek "=", pOrderValue
.Delete
.Close
End With
End If
================
However, because it is now split the Index and Seek cannot be used. I
think, from what I've read in this newsgroup and in Help, that I might
have to create an SQL statement with a WHERE in it based on the value
as defined by 'pOrderValue' above.
I've had a number of attempts in creating this sort of statement but
it always ends in an error or won't compile.
Could someone point me in the right direction, please?
Roderick