Still on ActiveX documents

Posted on 2003-04-01
Medium Priority
Last Modified: 2010-05-01
'Codes in Module1.bas
Option Explicit
Public oDoc1 As UserDocument1

Public Sub Main()

End Sub

'Codes in UserDocument1.vbd
Option Explicit
Private mvarUser    As String

Public Static Property Get User() As String
    If IsObject(mvarUser) Then
        User = mvarUser
        User = mvarUser
    End If
End Property

Public Static Property Let User(ByVal vNewValue As String)
    mvarUser = vNewValue
End Property

Private Sub Command1_Click()
    User = Text1.Text 'contains some text
    Hyperlink.NavigateTo App.Path & "\UserDocument2.vbd"
End Sub

'Codes in UserDocument2.vbd
Option Explicit

Private Sub UserDocument_Show()
   If Not oDoc1 Is Nothing Then
      Text1.Text = oDoc1.User  'expect to pick my text from UserDocument2.vbd which is to be displayed on a Text1 on UserDocument1.vbd
      MsgBox oDoc1.User
      Set oDoc1 = Nothing
   End If
End Sub

Nothing is saved on the User property.
Urgent got to meet a deadline
Question by:tiha
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

AKbor75 earned 75 total points
ID: 8244740
as far as i know properties can only be used on class modules (i may be wrong about this).
so if i want to exchange settings between forms, i use global variabeles (in a module) or an ini file.
i think an ini file is the best option, cos that is easy and always works.

Expert Comment

ID: 8531204
Hi tiha,
This old question (QID 20569875) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
LVL 76

Expert Comment

ID: 9046615
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Akbor75's comment as answe6

Please leave any comments here within the next seven days.
EE Cleanup Volunteer

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question