Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6856753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:55:33+00:00 2026-05-27T01:55:33+00:00

I am struggling to make the thing working using VBA Class modules First class

  • 0

I am struggling to make the thing working using VBA Class modules

First class module is tDate

'--- Class1 tDate
Public d as Integer
Public m as Integer
Public y as Integer
'--- some get/let properties for d,m,y

Second class module is tRate

'--- Class2 tRate
Public pDate1 as New tDate
Public dValue as Double
'--- Now i'm trying to code properties 

Public Property Get FirstDate() As tDate
    FirstDate = pDate1
End Property

Public Property Set FirstDate(vDate As tDate)
    pDate1 = vDate  ' <----  ???
End Property

In simple module I have the following sub to test the class

Sub test()
    Dim myDate As New tDate 
    Dim r1 As New tRate

    myDate.SetDate "20/10/1996"

    r1.FirstDate = myDate ' <-----  "Compile error : Invalid use of property"
End Sub

What is the best solution to link small class1 object as a property of bigger class2?

Thank you!!
Nicholas


Problem resolved using Set :

Public Property Get FirstDate() As tDate
    Set FirstDate = pDate1
End Property

Public Property Set FirstDate(vDate As tDate)
    Set pDate1 = vDate 
End Property

and here as well :

 Set r1.FirstDate = myDate
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:55:34+00:00Added an answer on May 27, 2026 at 1:55 am

    Use Set to assign an object to a variable.

    Set r1.FirstDate = myDate
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make some text bold using HTML, but I'm struggling to get
I am completely new to python and struggling to make a simple thing work.
I've been struggling for ages trying to make a working PDF reader for iPhone/iPad,
I am struggling to make a decision regarding the correct organisation for a web
Erlang version: R13B01 Currently I'm struggling trying to make Erlang work with SSL. The
I have been struggling with the best way to make sure that the certain
I'm working on my first asp.net/web development application. Obviously, I'm very new to asp.net
Having worked through some tutorials on some basics via the iPhone, I'm struggling to
I'm struggling to get SOAP working in perl. In PHP it works perfectly, and
I am wanting to build a Restful API using WCF however I am struggling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.