Opening a form

DanielR

Registered User.
Local time
Today, 01:59
Joined
Mar 16, 2018
Messages
72
Trying to open a form using:
DoCmd.OpenForm "Notes"
Nothing happens.
Help!!
 
Do you in fact have a form called "Notes"? Is it already opened?

What happens if you directly open it by double clicking on it?

Can you post your database?
 
Did you made this form or someone else.
Chek if there are codes on its load or open event that wil make it invisible.
 
I got an error code 2501 cant open form.
I don't get that code anymore...just nothing happens.
I created the form.
When I double click on the form nothing happens.
Form.Load and Form.Open has no code in it.
Does this help?
 
Its currupted.
 
I created a new form and copied the old form content.
Ran once and same again.
 
I imported all the objects into a new database.
Tried running again and the same issue.
 
paste this to a Standard Module.

run the exportForm().
rename your old form.
run the importForm()
Code:
Public Sub exportForm(sFormName As String, sExportLocation As String)

    '' usage:
    ''
    '' exportForm "yourFormName", "d:\folder\"
    ''
    Dim c As Container
    Dim d As Document
    Set c = db.Containers("Forms")
    For Each d In c.Documents
        If d.Name = sFormName Then _
        Application.SaveAsText acForm, d.Name, sExportLocation & "Form_" & d.Name & ".txt"
    Next d

End Sub

Public Sub importForm(sFormName As String, sImportLocation As String)
    '' usage:
    ''
    '' importForm "yourFormName", "d:\folder\"
    ''
    '' if the form already exists, rename it first.
    ''
    Application.LoadFromText acForm, sFormName, sImportLocation & "Form_" & sFormName & ".txt"
End Sub
 
I rebuilt the form and discovered that when pop up property is set to No the form opens fine. When I set the pop up property to yes, the form doesn't open.
Any ideas?
 
Just a test, create new db and import all object. Run the form.
 
I was able to get it working:
Set pop up to yes and center to yes
Thank you for your help.
 

Users who are viewing this thread

Back
Top Bottom