Visual Basic Editor

G

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?
 
J

John Vinson

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]
 
G

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
 
J

John Vinson

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]
 
G

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
 
J

John Vinson

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top