Re: How to lock information

Tech-Archive recommends: Speed Up your PC by fixing your registry



Ok, i finally got it in the correct location and one is working, and the
other is not. it if giving me this error (image attached. attached is a image
showing my code exactly in the application.

----------

Private Sub Form_AfterUpdate()
If Not IsNull([CTM - Setup]) Then
[CTM - Setup].Locked = True
Else
[CTM - Setup].Locked = False
End If
End Sub

Private Sub Form_Current()
If Not IsNull([CTM - Setup]) Then
[CTM - Setup].Locked = True
Else
[CTM - Setup].Locked = False
End If
End Sub

----------

www.hekaent.com/Customers/P/PolyCast/images/error2465.jpg
www.hekaent.com/Customers/P/PolyCast/images/scriptError.jpg



Al Campagna wrote:
I think you haven't entered the code where it needs to be placed.
You don't enter the code into the "text box" beside the OnCuurent event, you open the
code "module" for the OnCurrent event, and put the code in there. But in Visiual Basic
I can't be sure...
Here's how it's done in Visiual Studio... should be the same, or very close...

*First, delete anything you have in the OnCurrent textbox...*
Now try Double clicking the OnCurrent text box on the right, or the OnCurrent name box
on the left.
Does a module open up?

Here's an example for causing a Beep on FormActivated...
I double click the text box to the right of the Activated event
This appears...

Private Sub Form1_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Activated

End Sub

Now I place my code between those lines...

Private Sub Form1_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Activated
Beep()
End Sub

Now when I run the form, I get a "Beep" sound

here is the code i am using and i am still getting that error concerning the
macro previously posted on image.
[quoted text clipped - 45 lines]
www.hekaent.com/Customers/P/PolyCast/images/onCurrent.bmp
www.hekaent.com/Customers/P/PolyCast/images/afterUpdateError.bmp

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200701/1

.



Relevant Pages

  • Re: How to lock information
    ... code "module" for the OnCurrent event, and put the code in there. ... Private Sub Form1_Activated ... Candia Computer Consulting. ... Microsoft Access MVP ...
    (microsoft.public.access.forms)
  • Re: OnCurrent not triggered by return from another form
    ... > Newsgroups: microsoft.public.access ... OnCurrent not triggered by return from another form ... > Private Sub ReturnButton_Click ... > DoCmd.RunCommand acCmdRefresh ...
    (microsoft.public.access.forms)
  • OnCurrent not triggered by return from another form
    ... OnCurrent not triggered by return from another form ... Private Sub ReturnButton_Click ... DoCmd.RunCommand acCmdRefresh ... the "Vol Info" form has a OnCurrent event property to execute a ...
    (microsoft.public.access.forms)
  • Re: Restrict entry in field
    ... when I copied the code into the form's OnCurrent I get an error. ... "vladi16" wrote: ... Use the AfterUpdate event of Result... ... Private Sub Result_AfterUpdate ...
    (microsoft.public.access.forms)
  • Re: The keydown event
    ... i did this and it seems to work fine to disable the beep ... Private Sub txtmrn_KeyPress(ByVal sender As Object, ... > I modified this the snippet a bit, it works fine in my test program, ...
    (microsoft.public.dotnet.framework.windowsforms)