ivonsurf123
Registered User.
- Local time
- Today, 01:14
- Joined
- Dec 8, 2017
- Messages
- 69
Hello,
Could you help me please? I have a problem with a if sentence and a query: I need to pass the POSITION.OldValue to another table but it is getting the new value instead.
Could you help me please? I have a problem with a if sentence and a query: I need to pass the POSITION.OldValue to another table but it is getting the new value instead.
Code:
Private Sub Position_BeforeUpdate(Cancel As Integer)
Dim str As String
If Me.POSITION.OldValue <> Me.POSITION.value Then
str = "INSERT INTO tbl_GCDS_Operations_Positions_fills " _
& "([REPLACEMENT FOR],[POSITION],[POSITION NAME],[Snr Dir],[UNIT],[REPLACEMENT LAST DATE],[CompanyStartDate],[Position Status]) VALUES " _
& "('" & Me![NAME] & "','" & Me![POSITION] & "','" & Me![POSITION] & "','" & Me![Reporting Level 1] & "','" & Me![Group] & "','" & Me![Leave Date] & "','" & Me![Company Start Date] & "','" & "Open" & "'); " _
'Debug.Print str
CurrentDb.Execute str
End If
End Sub