Scott Heslop
Registered User.
- Local time
- Today, 22:02
- Joined
- Aug 29, 2012
- Messages
- 17
Hi,
Ive recently changed my table from a *.MDB to a *.ACCDB and ive found an error which worked fine in *.MDB format but when i changed it over it gives me and error. Im wanting to change a field value from "Active" to "Archive" if i click on the archive button. Here is my code:
The red sections are where my code fails. Any suggestions?
Private Sub TransferButton_Click()
Dim cMsgTxt As String
Dim nAns As Integer
If cMode = "Active" Then
cMsgTxt = "Archive "
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & UCase(Me![cEmployeeForename])
End If
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & " " & UCase(Me![cEmployeeSurname])
End If
cMsgTxt = cMsgTxt & " ? Are you sure ?"
If MsgBox(cMsgTxt, vbYesNo) = vbNo Then
Exit Sub
End If
Me!cActiveOrArchived = "Archived"
Me.Requery
Else
cMsgTxt = "Reinstate "
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & UCase(Me![cEmployeeForename])
End If
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & " " & UCase(Me![cEmployeeSurname])
End If
cMsgTxt = cMsgTxt & " ? Are you sure ?"
If MsgBox(cMsgTxt, vbYesNo) = vbNo Then
Exit Sub
End If
Me!cActiveOrArchived = "Active"
Me.Requery
End If
End Sub
Ive recently changed my table from a *.MDB to a *.ACCDB and ive found an error which worked fine in *.MDB format but when i changed it over it gives me and error. Im wanting to change a field value from "Active" to "Archive" if i click on the archive button. Here is my code:
The red sections are where my code fails. Any suggestions?
Private Sub TransferButton_Click()
Dim cMsgTxt As String
Dim nAns As Integer
If cMode = "Active" Then
cMsgTxt = "Archive "
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & UCase(Me![cEmployeeForename])
End If
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & " " & UCase(Me![cEmployeeSurname])
End If
cMsgTxt = cMsgTxt & " ? Are you sure ?"
If MsgBox(cMsgTxt, vbYesNo) = vbNo Then
Exit Sub
End If
Me!cActiveOrArchived = "Archived"
Me.Requery
Else
cMsgTxt = "Reinstate "
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & UCase(Me![cEmployeeForename])
End If
If Not IsNull(Me![cEmployeeForename]) Then
cMsgTxt = cMsgTxt & " " & UCase(Me![cEmployeeSurname])
End If
cMsgTxt = cMsgTxt & " ? Are you sure ?"
If MsgBox(cMsgTxt, vbYesNo) = vbNo Then
Exit Sub
End If
Me!cActiveOrArchived = "Active"
Me.Requery
End If
End Sub