Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Visual Basic Editor

Discussion in 'Information Technology' started by Ronnie, Jul 28, 2006.

  1. Ronnie

    Ronnie
    Expand Collapse
    Guest

    I was making a change to a form and got a message from the visual basic
    editor which I ignored because I do not know Visual Basic. I now cannot make
    any changes or additions to any records within the form. (I can make changes
    from the table). Is there a way I can fix this?
    --
    Ronnie
     
  2. Loading...

    Similar Threads Forum Date
    Arts/Society Femme Visuale: Ina Kaur Language, Arts & Culture Apr 18, 2016
    What do you visualize when you think of Ik▫oaʼnkār ੴ Sikh Sikhi Sikhism Dec 20, 2011
    A Visual Presentation on Navigating SPN Forums More Efficiently Announcements Nov 17, 2011
    This Visually Impaired Is Adept at Manouvering Gatka Sikh Youth Jan 13, 2011
    Sikh News Punjab: Blind NRIs make ashram for visually challenged (IBN via Yahoo! India News) Breaking News Oct 24, 2007

  3. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Tue, 11 Jul 2006 10:10:02 -0700, Ronnie
    <Ronnie@discussions.microsoft.com> wrote:

    >I was making a change to a form and got a message from the visual basic
    >editor which I ignored because I do not know Visual Basic. I now cannot make
    >any changes or additions to any records within the form. (I can make changes
    >from the table). Is there a way I can fix this?


    Try Tools... Database Utilities... Compact and Repair; if that doesn't
    help, you'll need to fix the error. Access generally gives you error
    messages when there is an error, and ths solution is to fix the error,
    not ignore it!

    If you still get the message, please type Ctrl-G to open the VBA
    editor; select Debug... Compile <your database>. If you get any
    compilation errors, and can't figure out how to fix them, copy and
    paste the five or so lines surrounding the error to a message here,
    together with the actual text of the error message.

    John W. Vinson[MVP]
     
  4. Ronnie

    Ronnie
    Expand Collapse
    Guest

    The Database Utilities did not work. Had to try VBA. Here is the error
    message:
    HideStartupForm_Err:
    Const conPropertyNotFound = 3270
    If Err = conPropertyNotFound Then
    Dim db As DAO.Database
    Dim prop As DAO.Property
    Set db = CurrentDb()
    Set prop = db.CreateProperty("StartupForm", dbText, "Startup")
    db.Properties.Append prop
    Resume Next
    End If
    End Function

    --
    Ronnie


    "John Vinson" wrote:

    > On Tue, 11 Jul 2006 10:10:02 -0700, Ronnie
    > <Ronnie@discussions.microsoft.com> wrote:
    >
    > >I was making a change to a form and got a message from the visual basic
    > >editor which I ignored because I do not know Visual Basic. I now cannot make
    > >any changes or additions to any records within the form. (I can make changes
    > >from the table). Is there a way I can fix this?

    >
    > Try Tools... Database Utilities... Compact and Repair; if that doesn't
    > help, you'll need to fix the error. Access generally gives you error
    > messages when there is an error, and ths solution is to fix the error,
    > not ignore it!
    >
    > If you still get the message, please type Ctrl-G to open the VBA
    > editor; select Debug... Compile <your database>. If you get any
    > compilation errors, and can't figure out how to fix them, copy and
    > paste the five or so lines surrounding the error to a message here,
    > together with the actual text of the error message.
    >
    > John W. Vinson[MVP]
    >
     
  5. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Tue, 11 Jul 2006 11:25:02 -0700, Ronnie
    <Ronnie@discussions.microsoft.com> wrote:

    >The Database Utilities did not work. Had to try VBA. Here is the error
    >message:
    >HideStartupForm_Err:
    > Const conPropertyNotFound = 3270
    > If Err = conPropertyNotFound Then
    > Dim db As DAO.Database
    > Dim prop As DAO.Property
    > Set db = CurrentDb()
    > Set prop = db.CreateProperty("StartupForm", dbText, "Startup")
    > db.Properties.Append prop
    > Resume Next
    > End If
    >End Function


    You didn't post the error message... but I'll GUESS that it's
    something like "User defined datatype...".

    If so, open the VBA editor. Select Tools... References. Scroll down
    the list until you find

    Microsoft DAO 3.6 Object Library

    (or the highest version you have, they vary with the version of
    Access). Check it. Close the References window and select Debug...
    Compile.

    If it's some other error, please post the actual error message.

    John W. Vinson[MVP]
     
  6. Ronnie

    Ronnie
    Expand Collapse
    Guest

    I have no idea what the error is. I do not have any knowledge of VB so it's
    frustrating to get a message that seems to be in another language. I did not
    see any of the verbage you mentioned in your previous reply. I have copied
    the whole message:


    Function OpenStartup() As Boolean
    ' Displays Startup form only if database is not a design master or replica.
    ' Used in OnOpen property of Startup form.
    On Error GoTo OpenStartup_Err
    If IsItAReplica() Then
    ' This database is a design master or replica, so close Startup form
    ' before it is displayed.
    DoCmd.Close
    Else
    ' This database is not a design master or replica, so display
    Startup form.
    ' Set the value of HideStartupForm check box using the value of
    ' StartupForm property of database (as set in code or in the
    ' Display Form/Page box in Startup dialog box).
    If (CurrentDb().Properties("StartupForm") = "Startup" Or _
    CurrentDb().Properties("StartupForm") = "Form.Startup") Then
    ' StartupForm property is set to Startup, so clear HideStartupForm
    ' check box.
    Forms!Startup!HideStartupForm = False
    Else
    ' StartupForm property is not set to Startup, so check
    HideStartupForm
    ' checkbox.
    Forms!Startup!HideStartupForm = True
    End If
    End If

    OpenStartup_Exit:
    Exit Function

    OpenStartup_Err:
    Const conPropertyNotFound = 3270
    If Err = conPropertyNotFound Then
    Forms!Startup!HideStartupForm = True
    Resume OpenStartup_Exit
    End If
    End Function

    Function HideStartupForm()
    On Error GoTo HideStartupForm_Err
    ' Uses the value of HideStartupForm check box to determine the setting for
    ' StartupForm property of database. (The setting is displayed in Display Form
    ' box in Startup dialog box).
    ' Used in OnClose property of Startup form.
    If Forms!Startup!HideStartupForm Then
    ' HideStartupForm check box is checked, so set StartupForm property
    to Main SwitchBoard.
    CurrentDb().Properties("StartupForm") = "Main SwitchBoard"
    Else
    ' HideStartupForm check box is cleared, so set StartupForm
    property to Startup.
    CurrentDb().Properties("StartupForm") = "Startup"
    End If

    Exit Function

    HideStartupForm_Err:
    Const conPropertyNotFound = 3270
    If Err = conPropertyNotFound Then
    Dim db As DAO.Database
    Dim prop As DAO.Property
    Set db = CurrentDb()
    Set prop = db.CreateProperty("StartupForm", dbText, "Startup")
    db.Properties.Append prop
    Resume Next
    End If
    End Function
    Function CloseForm()
    ' Closes Startup form.
    ' Used in OnClick property of OK command button on Startup form.
    DoCmd.Close
    DoCmd.OpenForm ("Main Switchboard")
    End Function
    Function IsItAReplica() As Boolean
    On Error GoTo IsItAReplica_Err
    ' Determines if database is a design master or a replica.
    ' Used in OpenStartup function.

    Dim blnReturnValue As Boolean

    blnReturnValue = False
    If CurrentDb().Properties("Replicable") = "T" Then
    ' Replicable property setting is "T",
    ' so database is a design master or replica.
    blnReturnValue = True
    Else
    ' Replicable property setting is not "T",
    ' so database is not a design master or replica.
    blnReturnValue = False
    End If

    IsItAReplica_Exit:
    IsItAReplica = blnReturnValue
    Exit Function

    IsItAReplica_Err:
    Resume IsItAReplica_Exit

    End Function

    --
    Ronnie


    "John Vinson" wrote:

    > On Tue, 11 Jul 2006 11:25:02 -0700, Ronnie
    > <Ronnie@discussions.microsoft.com> wrote:
    >
    > >The Database Utilities did not work. Had to try VBA. Here is the error
    > >message:
    > >HideStartupForm_Err:
    > > Const conPropertyNotFound = 3270
    > > If Err = conPropertyNotFound Then
    > > Dim db As DAO.Database
    > > Dim prop As DAO.Property
    > > Set db = CurrentDb()
    > > Set prop = db.CreateProperty("StartupForm", dbText, "Startup")
    > > db.Properties.Append prop
    > > Resume Next
    > > End If
    > >End Function

    >
    > You didn't post the error message... but I'll GUESS that it's
    > something like "User defined datatype...".
    >
    > If so, open the VBA editor. Select Tools... References. Scroll down
    > the list until you find
    >
    > Microsoft DAO 3.6 Object Library
    >
    > (or the highest version you have, they vary with the version of
    > Access). Check it. Close the References window and select Debug...
    > Compile.
    >
    > If it's some other error, please post the actual error message.
    >
    > John W. Vinson[MVP]
    >
    >
    >
     
  7. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Wed, 12 Jul 2006 07:48:02 -0700, Ronnie
    <Ronnie@discussions.microsoft.com> wrote:

    >I have no idea what the error is. I do not have any knowledge of VB so it's
    >frustrating to get a message that seems to be in another language. I did not
    >see any of the verbage you mentioned in your previous reply. I have copied
    >the whole message:
    >


    We're not communicating. You said that you got an error message. To
    quote:

    "I was making a change to a form and got a message from the visual
    basic editor which I ignored "

    What you have been posting is NOT an error message; it's the Visual
    Basic code. There might be an error in there somewhere, but I can't
    easily identify it without knowing what was the ACTUAL ERROR MESSAGE.

    This message (should have) appeared in a popup textbox when you
    attempted to run the code, or perhaps when you used Debug... Complile
    on the Menu.


    John W. Vinson[MVP]
     

Share This Page