B
Billp
Hi,
I am trying to delete from a table, before then, inputting new information
I have the following,
Private Sub Cust_Alias_ID_AfterUpdate()
Dim strSQLDelete As String 'SQL Statement to delete any old records
before appending new ones.
Dim strOtherFields As String
strOtherFields = ",LastName,FirstName,ContactName,Title,Region" _
& ",WorkPhone,WorkDDI,WorkExtension,MobilePhone,FaxNumber" _
& ",EmailName,Has_Left,Corp_Brochure,Calendar_Sent,Diary" _
& ",Last_Visit_Date,Last_Contact,Enquiry_Status,Follow_Up" _
& ",ContactNotes,ContactsInterests,Birthdate,Hometown" _
& ",HomePhone,MaritalStatus,SpouseName,SpousesInterests" _
& ",ChildrenNames"
strSQLDelete = "DELETE [tblCustomerContacts]" _
& "(CustomerID" & strOtherFields & ") " _
& "WHERE '" & CustomerID & "' = '" & Me.CustomerID & "'"
DBEngine(0)(0).Execute strSQLDelete, dbFailOnError
I have tried
"WHERE CustomerID = 'Me!CustomerID'"
"WHERE CustomerID = '" & Me.CustomerID & "'"
To know avail at present
And I am getting currently
error 3075 - Syntax error (missing operator) in query
'[tblCustomerContacts](CustomerID) WHERE "WWWBPW' = "WWWBPW'
The customerID are linked in 2 tables.
On the main form the field "customerID" shows a six digit customer code.
The user can update customer contact lists based on a combo cboCustomerID.
When the user has selected a new contact from the combo I want the old
contacts relating to the current form "CustomerID" to be deleted for the
subtable before the new contacts are added . And do you think for the life of
me I can get the delete part to work?????????????
Ant suggestions gratefully accepted and willingly implemented.
With Thanks
Bill
PS: The weekend is oh so near - just minutes away
I am trying to delete from a table, before then, inputting new information
I have the following,
Private Sub Cust_Alias_ID_AfterUpdate()
Dim strSQLDelete As String 'SQL Statement to delete any old records
before appending new ones.
Dim strOtherFields As String
strOtherFields = ",LastName,FirstName,ContactName,Title,Region" _
& ",WorkPhone,WorkDDI,WorkExtension,MobilePhone,FaxNumber" _
& ",EmailName,Has_Left,Corp_Brochure,Calendar_Sent,Diary" _
& ",Last_Visit_Date,Last_Contact,Enquiry_Status,Follow_Up" _
& ",ContactNotes,ContactsInterests,Birthdate,Hometown" _
& ",HomePhone,MaritalStatus,SpouseName,SpousesInterests" _
& ",ChildrenNames"
strSQLDelete = "DELETE [tblCustomerContacts]" _
& "(CustomerID" & strOtherFields & ") " _
& "WHERE '" & CustomerID & "' = '" & Me.CustomerID & "'"
DBEngine(0)(0).Execute strSQLDelete, dbFailOnError
I have tried
"WHERE CustomerID = 'Me!CustomerID'"
"WHERE CustomerID = '" & Me.CustomerID & "'"
To know avail at present
And I am getting currently
error 3075 - Syntax error (missing operator) in query
'[tblCustomerContacts](CustomerID) WHERE "WWWBPW' = "WWWBPW'
The customerID are linked in 2 tables.
On the main form the field "customerID" shows a six digit customer code.
The user can update customer contact lists based on a combo cboCustomerID.
When the user has selected a new contact from the combo I want the old
contacts relating to the current form "CustomerID" to be deleted for the
subtable before the new contacts are added . And do you think for the life of
me I can get the delete part to work?????????????
Ant suggestions gratefully accepted and willingly implemented.
With Thanks
Bill
PS: The weekend is oh so near - just minutes away