|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Passing a value to a formI am using VB6.
Years ago, I passed a value to a form. For the life of me, I don't remember how I did it. I could use property get or let. Or use the user defined Type object. I would prefer just to open up the form and pass it a value. How to do this? "Rich" <richma***@earthlink.net> wrote in message Public Sub ShowMe(ByVal Param1 As String)news:18feaec1-35b9-4cc8-80fa-1cde2dee9bdd@z19g2000vbz.googlegroups.com... > > I am using VB6. > > Years ago, I passed a value to a form. For the life of me, I don't > remember how I did it. > > I could use property get or let. Or use the user defined Type object. > > I would prefer just to open up the form and pass it a value. How to do > this? Me.Show vbModal End Sub
Show quote
Hide quote
"Nobody" <nob***@nobody.com> wrote in message Or:news:ehO$GFM2JHA.2656@TK2MSFTNGP05.phx.gbl... > "Rich" <richma***@earthlink.net> wrote in message > news:18feaec1-35b9-4cc8-80fa-1cde2dee9bdd@z19g2000vbz.googlegroups.com... >> >> I am using VB6. >> >> Years ago, I passed a value to a form. For the life of me, I don't >> remember how I did it. >> >> I could use property get or let. Or use the user defined Type object. >> >> I would prefer just to open up the form and pass it a value. How to do >> this? > > Public Sub ShowMe(ByVal Param1 As String) > Me.Show vbModal > End Sub Private m_sPassword As String Public Function GetPassword() As String m_sPassword = "" Me.Show vbModal GetPassword = m_sPassword End Sub Private Sub btnOK_Click() m_sPassword = txtPassword.Text End Sub Aside from Nobody's solution I have also used properties, just
like you mentioned. Either way works ok. Saga Show quoteHide quote "Rich" <richma***@earthlink.net> wrote in message news:18feaec1-35b9-4cc8-80fa-1cde2dee9bdd@z19g2000vbz.googlegroups.com... > > I am using VB6. > > Years ago, I passed a value to a form. For the life of me, I don't > remember how I did it. > > I could use property get or let. Or use the user defined Type object. > > I would prefer just to open up the form and pass it a value. How to do > this? "Rich" <richma***@earthlink.net> wrote in message I just want to clarify: without explictly adding a property or a method, news:18feaec1-35b9-4cc8-80fa-1cde2dee9bdd@z19g2000vbz.googlegroups.com... > I am using VB6. > > Years ago, I passed a value to a form. For the life of me, I don't > remember how I did it. > > I could use property get or let. Or use the user defined Type object. > > I would prefer just to open up the form and pass it a value. How to do > this? there is no way to pass a value to a form*. In Access there is the concept of passing arguments when opening a form; there is no such thing in VB. *Yes, pedants, you could set one of the built-in properties, like Tag, but you can't REACT to that value being set, which is what I assume the poster wants. |
|||||||||||||||||||||||