latex88
Registered User.
- Local time
- Today, 13:36
- Joined
- Jul 10, 2003
- Messages
- 198
I have such hard time with the syntax. I'll be grateful if someone can provide a link where I can learn about various syntax when referencing variables in various functions.
I'm trying to delete a record from a table that is trigger by a button in a continuous form based on an ID found via dlookup. I was able to find the ID OK using Dlookup (which was amazing), but the DoCmd.RunSQL is killing me. Below is what I have so far. When I tried to run it, it's prompting for RecordToBeDeleted.
I'm trying to delete a record from a table that is trigger by a button in a continuous form based on an ID found via dlookup. I was able to find the ID OK using Dlookup (which was amazing), but the DoCmd.RunSQL is killing me. Below is what I have so far. When I tried to run it, it's prompting for RecordToBeDeleted.
Dim RecordToBeDeleted As Integer
Dim strSql As String
RecordToBeDeleted = DLookup("ID", "myTable1", "[ID]= ([txtID])")
strSql = "Delete * FROM [myTable2] WHERE ([myTable2.ID] = RecordToBeDeleted )"
DoCmd.RunSQL strSql