J
Jon
I have a form for entering data into a table. I put the following vb code On
close event of the form:
Private Sub Form_Close()
Me.CloseButton = True
If Len(Trim$(Me![MachName] & vbNullString)) = 0 Then
MsgBox (" You can not close this Form without Mach. Name ")
Me.MachName.SetFocus
Me.CloseButton = False
ElseIf IsNull(Me.Code) Then
MsgBox (" You can not close this Form without Mach. Code ")
Me.MachName.SetFocus
Me.CloseButton = False
Else
Me.CloseButton = True
End If
End Sub
But the problem is an error that tells "you can not assign a value to this
object "
Can any body correct my code please??
close event of the form:
Private Sub Form_Close()
Me.CloseButton = True
If Len(Trim$(Me![MachName] & vbNullString)) = 0 Then
MsgBox (" You can not close this Form without Mach. Name ")
Me.MachName.SetFocus
Me.CloseButton = False
ElseIf IsNull(Me.Code) Then
MsgBox (" You can not close this Form without Mach. Code ")
Me.MachName.SetFocus
Me.CloseButton = False
Else
Me.CloseButton = True
End If
End Sub
But the problem is an error that tells "you can not assign a value to this
object "
Can any body correct my code please??