Exposing UserControl's Constituent Ctrl Property

Posted on 2000-04-06
Last Modified: 2013-12-25
Please help.  I am on a tight timeline (as always!!).  I really need some URGENT help.

I have created a user control(UC) with some text boxes.  In another project, I have a form (form1) with a datarepeater (drptAll) that is using the UC I made as its RepeatedControlName with a adodc (adoTP).  Now when the user enters info in the drptAll in 3 of the UC text boxes (year, month, day), I would like to update the 4th UC text box (TPVal) with a calculation based on the 1st 3 fields.  I am using the Let, Get, and Changed (PropertyChanged) procedures in my UC.

In my project, I have the datarepeater
I am a complete novice to building usercontrols etc. so you will have to explain some things.  I tried to do it from the UC but nothing happened.  Should I be doing it from my form1?  If so, where is the "Changed" property of my fields and how do I use it?  Here is my UC code:
Public Property Get Yr() As String
    Yr = txtYr.Text
End Property

Public Property Let Yr(ByVal newYear As String)
    txtYr.Text = newYear
End Property

Public Property Get Mnth() As String
    Mnth = txtMon.Text
End Property

Public Property Let Mnth(ByVal newMonth As String)
    txtMon.Text = newMonth
End Property

Public Property Get Dy() As String
    Dy = txtDay.Text
End Property

Public Property Let Dy(ByVal newDay As String)
    txtDay.Text = newDay
End Property

Public Property Get TPVal() As String
'    TPVal = txtTPVal.Text
    TPVal = (CInt(txtYr.Text) * 12) + (CInt(txtMon.Text)) + (CInt(txtDay.Text) / 31)
End Property

Public Property Let TPVal(ByVal newTPVal As String)
    txtTPVal.Text = newTPVal
End Property


Thanks in advance.
Question by:mcb123
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

Author Comment

ID: 2693731
Please help - I really am desperate!!!

Accepted Solution

GivenRandy earned 70 total points
ID: 2764312
It looks like you're trying to do both class based (e.g., ActiveX control/exe/dll) and "user control" at the same time.  If you are just using a user control with the text boxes you defined, try using the following code instead:


Private Sub txtMon_Change()
End Sub

Private Sub txtYr_Change()
End Sub

Private Sub txtDay_Change()
End Sub

Private Sub SetTPVal()
    txtTPVal.Text = (Val(txtYr.Text) * 12) + Val(txtMon.Text) + (Val(txtDay.Text) / 31)
End Sub


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

719 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