Unexplained Persistence 
Author Message
 Unexplained Persistence

Hi...

I put a message here already titled "showing the userform" but I've another,
to me unexplained thing going on.

I'm putting checkboxes in a frame wich is on a page of a multipage control.
When I shut down the application and even the whole machine and then restart
the program then the status of the checkboxes is the same.

Can anyone tell me why please??

Regards and TIA
Lisa Green



Tue, 08 Nov 2005 20:15:16 GMT  
 Unexplained Persistence
Hi Lisa,

You'll have to store the values.

In below example i'm utilizing CustomDocumentProperties as
the storage tool

Private Sub UserForm_Initialize()
    'read values from properties and populate the checkboxes
    With Me.CheckBox1
        .Value = _
        ActiveDocument.CustomDocumentProperties(.Name)
    End With
    With Me.CheckBox2
        .Value = _
        ActiveDocument.CustomDocumentProperties(.Name)
    End With
End Sub

Private Sub UserForm_Terminate()
    'store the selected values of checkboxes to docprops
    With Me.CheckBox1
        ActiveDocument.CustomDocumentProperties(.Name) = _
            .Value
    End With
    With Me.CheckBox2
        ActiveDocument.CustomDocumentProperties(.Name) = _
            .Value
    End With
End Sub

Krgrds,
Perry



Quote:
> Hi...

> I put a message here already titled "showing the userform" but I've
another,
> to me unexplained thing going on.

> I'm putting checkboxes in a frame wich is on a page of a multipage
control.
> When I shut down the application and even the whole machine and then
restart
> the program then the status of the checkboxes is the same.

> Can anyone tell me why please??

> Regards and TIA
> Lisa Green



Wed, 09 Nov 2005 18:00:37 GMT  
 Unexplained Persistence
Hi Perry...

Ummm this is happening without any coding on my part at all.
I was just wondering why and if anyone had come across this before.

Lisa



Wed, 09 Nov 2005 18:40:20 GMT  
 Unexplained Persistence
Hi Perry...

I'm embarrased to say I actually am setting the control values.

I run a SaveControlsToRegistry procedure at the end of the application and a
LoadControlsFromRegistry procedure at the start.

I'd forgotten about them because they are in a sort of application template
that I use.

My apologies.

Regards
Lisa Green



Sat, 12 Nov 2005 21:25:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. unexplained error

2. Unexplained Run-Time error #48

3. Unexplained "Invalid Use of Property"

4. Strange (and unexplained) error reported to event log

5. Unexplained Corruption problems of using VB And MS-Access

6. Unexplained ADO Error - .AddNew

7. Unexplained behavior

8. Persistence of Shelled Application

9. Using same mechanism for object serialization and DB persistence

10. Persistence between 2 exe's on same machine

11. Persistence of variables

12. Recordset persistence with ADO Stream

 

 
Powered by phpBB® Forum Software