A
Al
I have a form that I want to replace the contents of one
field with the contents of another field if the user
clicks a command button. It shifts the fields up one...
However, when I get past the msgbox to the first If
statement, I get an error, "Object Required." Also, I'm
getting a response value for 'vbYes' of 6... is this right?
What am I doing wrong?
Private Sub DOff1_Click()
Dim Lid As Integer
Dim Off1 As Variant
Dim Off2 As Variant
Dim Response As String
On Error GoTo Err_DOff1_Click
Lid = Me.LOGID
Off1 = Me.TOff1
Off2 = Me.TOff2
Response = MsgBox("Are you sure you want to remove " &
Off1 & "?", vbYesNo)
If Response = vbYes And Off2 Is Null Then
DoCmd.RunSQL "UPDATE Log SET OFFNAME1 = " & Off2
& "WHERE LOGID = " & Lid
Else
field with the contents of another field if the user
clicks a command button. It shifts the fields up one...
However, when I get past the msgbox to the first If
statement, I get an error, "Object Required." Also, I'm
getting a response value for 'vbYes' of 6... is this right?
What am I doing wrong?
Private Sub DOff1_Click()
Dim Lid As Integer
Dim Off1 As Variant
Dim Off2 As Variant
Dim Response As String
On Error GoTo Err_DOff1_Click
Lid = Me.LOGID
Off1 = Me.TOff1
Off2 = Me.TOff2
Response = MsgBox("Are you sure you want to remove " &
Off1 & "?", vbYesNo)
If Response = vbYes And Off2 Is Null Then
DoCmd.RunSQL "UPDATE Log SET OFFNAME1 = " & Off2
& "WHERE LOGID = " & Lid
Else