Moving a form to a another folder the code no longer works

G

Guest

Hi All

When I move a form to a new folder, the code behind the form does not work
any more and all my fields are initialised to enable mode which were
originally disabled

Can anyone help ?

Regards

ZAK
 
L

Long Nguyen

When you said you moved the form to the new folder you mean the form item or
you mean the form template? If it was the form design I would think there
should be no problem, but if it was the form item then you need to make sure
the form template is accessible when you open the item in the new folder (I
mean at the time you open the form the template needs to be either in the
cache, or the personal form library, or the current folder etc).

Long
 
G

Guest

HI

I am moving the form item as per the code below. Each of the folder has the
same form attached to it. Which I have installed on all the folders.

Code is :

Sub cmdProcess_Click()

Dim objFolder
Dim objItem
Dim objNS
Dim objInsp


Set objNS = Application.GetNamespace("MAPI")
Set objInsp = Application.ActiveInspector
Set objPage = Item.GetInspector.ModifiedFormPages("Product")
Set m_objControls = objPage.Controls

' point to the current item with the variable
If Not objInsp Is Nothing Then
Set objItem = objInsp.CurrentItem
end if


If m_objControls("chkProduction").Enabled = false then

Set objFolder = objNS.Folders.Item("Public Folders"). _
Folders.Item("All Public Folders"). _
Folders.Item("Product Creation"). _
Folders.Item("Operation"). _
Folders.Item("Production")
m_objControls("chkProduction").Enabled = true
objItem.Move objFolder

End If

Regards

Yamin
 

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