vernthemerciless
New member
- Local time
- Today, 14:51
- Joined
- Aug 21, 2008
- Messages
- 3
Can anyone please help me?! I’ve got two problems with a database which I have been creating for the office I work in. I’ve not used visual basic before and therefore this is something of a learning experience.
1. I have a database where many records that do not have a “Status”of “Live” do not need to be edited. To prevent people accidentally editing these records I’ve been trying to code into the form a process whereby if the “Status” of a record is not “Live” then all the other controls are locked. Having looked at the MS website a various forums I’ve got this code written in (at present I’m just try to lock three of the controls until I can get it to work and then expand it to all of them):
Private Sub Form_Current()
If Me.STATUS = "Live" Then
Me.CLAIM.Locked = False
Me.VESSEL.Locked = False
Me.INSURED.Locked = False
Else
Me.CLAIM.Locked = True
Me.VESSEL.Locked = True
Me.INSURED.Locked = True
End If
End Sub
However this doesn’t seem to do anything at all, all the records are still fully editable. Can someone please give me some pointers to get this to work.
2. I also want to create a pop-up box so that when someone logs an “Event” in the history section of the form that it will remind them to schedule a follow-up action. However I also cannot get this to do anything although this would seem to be the correct string from what I’ve read.
Private Sub Date1_Change()
MsgBox ("Continue?")
End Sub
Can anyone help with this?
Thanks
V
1. I have a database where many records that do not have a “Status”of “Live” do not need to be edited. To prevent people accidentally editing these records I’ve been trying to code into the form a process whereby if the “Status” of a record is not “Live” then all the other controls are locked. Having looked at the MS website a various forums I’ve got this code written in (at present I’m just try to lock three of the controls until I can get it to work and then expand it to all of them):
Private Sub Form_Current()
If Me.STATUS = "Live" Then
Me.CLAIM.Locked = False
Me.VESSEL.Locked = False
Me.INSURED.Locked = False
Else
Me.CLAIM.Locked = True
Me.VESSEL.Locked = True
Me.INSURED.Locked = True
End If
End Sub
However this doesn’t seem to do anything at all, all the records are still fully editable. Can someone please give me some pointers to get this to work.
2. I also want to create a pop-up box so that when someone logs an “Event” in the history section of the form that it will remind them to schedule a follow-up action. However I also cannot get this to do anything although this would seem to be the correct string from what I’ve read.
Private Sub Date1_Change()
MsgBox ("Continue?")
End Sub
Can anyone help with this?
Thanks
V