K
Karen K.
I have a form with a command button. I'm trying to make
the button change the value of the "blockuser" field in
the table "tblBlockUser".
Q: Is the code below the easiest way to change the value?
Q: How do I call for the current value?
Dim MyDB As Database
Dim MyRS As Recordset
Set MyDB = CurrentDb()
Set MyRS = MyDB.OpenRecordset("tblBlockuser")
With MyRS
.Edit
If msgResult = vbYes Then
!BlockUser = True
Me.cmdBlock.ForeColor = 255
Me.cmdBlock.FontBold = True
Else
!BlockUser = False
Me.cmdBlock.ForeColor = 0
Me.cmdBlock.FontBold = False
End If
.Update
End With
MyRS.Close
MyDB.Close
the button change the value of the "blockuser" field in
the table "tblBlockUser".
Q: Is the code below the easiest way to change the value?
Q: How do I call for the current value?
Dim MyDB As Database
Dim MyRS As Recordset
Set MyDB = CurrentDb()
Set MyRS = MyDB.OpenRecordset("tblBlockuser")
With MyRS
.Edit
If msgResult = vbYes Then
!BlockUser = True
Me.cmdBlock.ForeColor = 255
Me.cmdBlock.FontBold = True
Else
!BlockUser = False
Me.cmdBlock.ForeColor = 0
Me.cmdBlock.FontBold = False
End If
.Update
End With
MyRS.Close
MyDB.Close