D
Dan
I have a database that keeps tracks of our members
information. When a record is inserted (on the form that
we use), by default the members status is "Active". I
have it so that when their status changes to "Account
Recievable" that it inserts a record into the "Accounts
Recievable" Table and when the status changes from
the "Accounts Recievable" Table that it deletes the
record. This is the code that I have:
If [Status] = "Account Recievable" Then
Dim strSQL As String
strSQL = "INSERT INTO [New AR Table] _
([Member Number]) " & _
"VALUES(" & Me.Member_Number & ")"
CurrentDb.Execute strSQL, dbFailOnError
Else
strSQL = "Delete FROM [New AR TABLE] WHERE _
([Member Number]) = " & _
Me.[Member Number]
CurrentDb.Execute strSQL, dbFailOnError
End If
What I need to do is have it check to see if the record
already exists in the table before it inserts or deletes
one of the records. [Member Number] is the primary key.
information. When a record is inserted (on the form that
we use), by default the members status is "Active". I
have it so that when their status changes to "Account
Recievable" that it inserts a record into the "Accounts
Recievable" Table and when the status changes from
the "Accounts Recievable" Table that it deletes the
record. This is the code that I have:
If [Status] = "Account Recievable" Then
Dim strSQL As String
strSQL = "INSERT INTO [New AR Table] _
([Member Number]) " & _
"VALUES(" & Me.Member_Number & ")"
CurrentDb.Execute strSQL, dbFailOnError
Else
strSQL = "Delete FROM [New AR TABLE] WHERE _
([Member Number]) = " & _
Me.[Member Number]
CurrentDb.Execute strSQL, dbFailOnError
End If
What I need to do is have it check to see if the record
already exists in the table before it inserts or deletes
one of the records. [Member Number] is the primary key.