Noone Responded, Still need Help!!! 
Author Message
 Noone Responded, Still need Help!!!

I'm creating an ActiveX control, and I want to pass the .RowSource property
just like in the DataCombo control, but it won't except the object, and I
don't know how to reference the dataenvironment using a string.  Can anyont
tell me how to do this?

Dan



Tue, 10 May 2005 03:47:48 GMT  
 Noone Responded, Still need Help!!!
Post your code. Are you using Property Set instead of Property Let? If
passing objects, you need Set... not Let

--
Ken Halter - MS-MVP-VB - Please keep it in the groups..
http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
http://www.vbsight.com/TBGDialogCTL.htm

Quote:
> I'm creating an ActiveX control, and I want to pass the .RowSource
property
> just like in the DataCombo control, but it won't except the object, and I
> don't know how to reference the dataenvironment using a string.  Can
anyont
> tell me how to do this?

> Dan



Tue, 10 May 2005 04:16:22 GMT  
 Noone Responded, Still need Help!!!
I eliminated the extra variables, but this gets the idea across.  I used the
ActiveX Control Interface Wizard to generate all of this.

You can see where I'm trying to add the recordset to the listbox in the
Usercontrol_Show sub, but it errors at the RowSource lines.  Also, this
property doesn't show up in the properties box on the design screen.  How
come?

Dan

Dim m_RowSource As Object

Public Property Get RowSource() As Object
  Set RowSource = m_RowSource
End Property

Public Property Set RowSource(ByVal New_RowSource As Object)
  Set m_RowSource = New_RowSource
  PropertyChanged "RowSource"
End Property

Private Sub UserControl_InitProperties()
  Set m_RowSource = Nothing
End Sub

'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  Set m_RowSource = PropBag.ReadProperty("RowSource", Nothing)
End Sub

Private Sub UserControl_Show()
  Dim tblSource As Object, IntLoop As Double ', cnn As adodb.Connection

  ucHeight = UserControl.Height
  If Ambient.UserMode Then
    'Set cnn = New Recordset
    If m_BoundField = "" Then m_BoundField = m_RowField
    If m_RowSource.Recordsets(m_RowMember).State = 1 Then
m_RowSource.Recordsets(m_RowMember).Close
    m_RowSource.Recordsets(m_RowMember).Open
    Set tblSource = m_RowSource.Recordsets(m_RowMember)
    ReDim aryDataList(0 To tblSource.RecordCount, 0 To 1)
    For IntLoop = 0 To tblSource.RecordCount
      aryDataList(IntLoop, 0) = tblSource.Fields(m_RowField)
      aryDataList(IntLoop, 1) = tblSource.Fields(m_BoundField)
      lstDropList.AddItem tblSource.Fields(m_RowField)
      tblSource.MoveNext
      If tblSource.EOF Then Exit For
    Next IntLoop
  End If
End Sub

'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    Call PropBag.WriteProperty("RowSource", m_RowSource, Nothing)
End Sub


Quote:
> Post your code. Are you using Property Set instead of Property Let? If
> passing objects, you need Set... not Let

> --
> Ken Halter - MS-MVP-VB - Please keep it in the groups..
> http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
> http://www.vbsight.com/TBGDialogCTL.htm


> > I'm creating an ActiveX control, and I want to pass the .RowSource
> property
> > just like in the DataCombo control, but it won't except the object, and
I
> > don't know how to reference the dataenvironment using a string.  Can
> anyont
> > tell me how to do this?

> > Dan



Tue, 10 May 2005 05:54:21 GMT  
 Noone Responded, Still need Help!!!
Is your 'lstDropList' control a DataList box? If not, these articles may help.

Data Sources, Data Sinks
http://www.aivosto.com/visdev/data.html

ActiveX Data Provider Tutorial
http://abstractvb.com/code.asp?F=135&P=2&A=707

ActiveX Data Consumer Tutorial
http://abstractvb.com/code/code705.asp

--
Ken Halter - MS-MVP-VB - Please keep it in the groups..
http://www.vbsight.com/ - http://www.vbsight.com/MultiColumn.htm
http://www.vbsight.com/TBGDialogCTL.htm

Quote:

> I eliminated the extra variables, but this gets the idea across.  I used the
> ActiveX Control Interface Wizard to generate all of this.

> You can see where I'm trying to add the recordset to the listbox in the
> Usercontrol_Show sub, but it errors at the RowSource lines.  Also, this
> property doesn't show up in the properties box on the design screen.  How
> come?

> Dan

> Dim m_RowSource As Object

> Public Property Get RowSource() As Object
>   Set RowSource = m_RowSource
> End Property

> Public Property Set RowSource(ByVal New_RowSource As Object)
>   Set m_RowSource = New_RowSource
>   PropertyChanged "RowSource"
> End Property

> Private Sub UserControl_InitProperties()
>   Set m_RowSource = Nothing
> End Sub

> 'Load property values from storage
> Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
>   Set m_RowSource = PropBag.ReadProperty("RowSource", Nothing)
> End Sub

> Private Sub UserControl_Show()
>   Dim tblSource As Object, IntLoop As Double ', cnn As adodb.Connection

>   ucHeight = UserControl.Height
>   If Ambient.UserMode Then
>     'Set cnn = New Recordset
>     If m_BoundField = "" Then m_BoundField = m_RowField
>     If m_RowSource.Recordsets(m_RowMember).State = 1 Then
> m_RowSource.Recordsets(m_RowMember).Close
>     m_RowSource.Recordsets(m_RowMember).Open
>     Set tblSource = m_RowSource.Recordsets(m_RowMember)
>     ReDim aryDataList(0 To tblSource.RecordCount, 0 To 1)
>     For IntLoop = 0 To tblSource.RecordCount
>       aryDataList(IntLoop, 0) = tblSource.Fields(m_RowField)
>       aryDataList(IntLoop, 1) = tblSource.Fields(m_BoundField)
>       lstDropList.AddItem tblSource.Fields(m_RowField)
>       tblSource.MoveNext
>       If tblSource.EOF Then Exit For
>     Next IntLoop
>   End If
> End Sub

> 'Write property values to storage
> Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
>     Call PropBag.WriteProperty("RowSource", m_RowSource, Nothing)
> End Sub



> > Post your code. Are you using Property Set instead of Property Let? If
> > passing objects, you need Set... not Let

> > --
> > Ken Halter - MS-MVP-VB - Please keep it in the groups..
> > http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
> > http://www.vbsight.com/TBGDialogCTL.htm


> > > I'm creating an ActiveX control, and I want to pass the .RowSource
> > property
> > > just like in the DataCombo control, but it won't except the object, and
> I
> > > don't know how to reference the dataenvironment using a string.  Can
> > anyont
> > > tell me how to do this?

> > > Dan



Wed, 11 May 2005 11:37:27 GMT  
 Noone Responded, Still need Help!!!
These are helpful, Thanks

I still need to know how to pass a string on a form in the usercontrolm back
to the usercontrol.  I can't seem to reference the object usercontrol, like
UserControl.TxtBox1.text = "String"

Any Thoughts.

Dan


Quote:
> Is your 'lstDropList' control a DataList box? If not, these articles may
help.

> Data Sources, Data Sinks
> http://www.aivosto.com/visdev/data.html

> ActiveX Data Provider Tutorial
> http://abstractvb.com/code.asp?F=135&P=2&A=707

> ActiveX Data Consumer Tutorial
> http://abstractvb.com/code/code705.asp

> --
> Ken Halter - MS-MVP-VB - Please keep it in the groups..
> http://www.vbsight.com/ - http://www.vbsight.com/MultiColumn.htm
> http://www.vbsight.com/TBGDialogCTL.htm




- Show quoted text -

Quote:
> > I eliminated the extra variables, but this gets the idea across.  I used
the
> > ActiveX Control Interface Wizard to generate all of this.

> > You can see where I'm trying to add the recordset to the listbox in the
> > Usercontrol_Show sub, but it errors at the RowSource lines.  Also, this
> > property doesn't show up in the properties box on the design screen.
How
> > come?

> > Dan

> > Dim m_RowSource As Object

> > Public Property Get RowSource() As Object
> >   Set RowSource = m_RowSource
> > End Property

> > Public Property Set RowSource(ByVal New_RowSource As Object)
> >   Set m_RowSource = New_RowSource
> >   PropertyChanged "RowSource"
> > End Property

> > Private Sub UserControl_InitProperties()
> >   Set m_RowSource = Nothing
> > End Sub

> > 'Load property values from storage
> > Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
> >   Set m_RowSource = PropBag.ReadProperty("RowSource", Nothing)
> > End Sub

> > Private Sub UserControl_Show()
> >   Dim tblSource As Object, IntLoop As Double ', cnn As adodb.Connection

> >   ucHeight = UserControl.Height
> >   If Ambient.UserMode Then
> >     'Set cnn = New Recordset
> >     If m_BoundField = "" Then m_BoundField = m_RowField
> >     If m_RowSource.Recordsets(m_RowMember).State = 1 Then
> > m_RowSource.Recordsets(m_RowMember).Close
> >     m_RowSource.Recordsets(m_RowMember).Open
> >     Set tblSource = m_RowSource.Recordsets(m_RowMember)
> >     ReDim aryDataList(0 To tblSource.RecordCount, 0 To 1)
> >     For IntLoop = 0 To tblSource.RecordCount
> >       aryDataList(IntLoop, 0) = tblSource.Fields(m_RowField)
> >       aryDataList(IntLoop, 1) = tblSource.Fields(m_BoundField)
> >       lstDropList.AddItem tblSource.Fields(m_RowField)
> >       tblSource.MoveNext
> >       If tblSource.EOF Then Exit For
> >     Next IntLoop
> >   End If
> > End Sub

> > 'Write property values to storage
> > Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
> >     Call PropBag.WriteProperty("RowSource", m_RowSource, Nothing)
> > End Sub



> > > Post your code. Are you using Property Set instead of Property Let? If
> > > passing objects, you need Set... not Let

> > > --
> > > Ken Halter - MS-MVP-VB - Please keep it in the groups..
> > > http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
> > > http://www.vbsight.com/TBGDialogCTL.htm


> > > > I'm creating an ActiveX control, and I want to pass the .RowSource
> > > property
> > > > just like in the DataCombo control, but it won't except the object,
and
> > I
> > > > don't know how to reference the dataenvironment using a string.  Can
> > > anyont
> > > > tell me how to do this?

> > > > Dan



Wed, 11 May 2005 14:56:07 GMT  
 Noone Responded, Still need Help!!!
If you mean that the control is placed inside the
usercontrol (meaning that the UC is the container)
have a look at the containedcontrols collection that
is part of the usercontrol.

If you're looking for a way to access the controls
directly on the form use the ParentControls collection.

D.



Quote:
> These are helpful, Thanks

> I still need to know how to pass a string on a form in the usercontrolm
back
> to the usercontrol.  I can't seem to reference the object usercontrol,
like
> UserControl.TxtBox1.text = "String"

> Any Thoughts.

> Dan



> > Is your 'lstDropList' control a DataList box? If not, these articles may
> help.

> > Data Sources, Data Sinks
> > http://www.aivosto.com/visdev/data.html

> > ActiveX Data Provider Tutorial
> > http://abstractvb.com/code.asp?F=135&P=2&A=707

> > ActiveX Data Consumer Tutorial
> > http://abstractvb.com/code/code705.asp

> > --
> > Ken Halter - MS-MVP-VB - Please keep it in the groups..
> > http://www.vbsight.com/ - http://www.vbsight.com/MultiColumn.htm
> > http://www.vbsight.com/TBGDialogCTL.htm



> > > I eliminated the extra variables, but this gets the idea across.  I
used
> the
> > > ActiveX Control Interface Wizard to generate all of this.

> > > You can see where I'm trying to add the recordset to the listbox in
the
> > > Usercontrol_Show sub, but it errors at the RowSource lines.  Also,
this
> > > property doesn't show up in the properties box on the design screen.
> How
> > > come?

> > > Dan

> > > Dim m_RowSource As Object

> > > Public Property Get RowSource() As Object
> > >   Set RowSource = m_RowSource
> > > End Property

> > > Public Property Set RowSource(ByVal New_RowSource As Object)
> > >   Set m_RowSource = New_RowSource
> > >   PropertyChanged "RowSource"
> > > End Property

> > > Private Sub UserControl_InitProperties()
> > >   Set m_RowSource = Nothing
> > > End Sub

> > > 'Load property values from storage
> > > Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
> > >   Set m_RowSource = PropBag.ReadProperty("RowSource", Nothing)
> > > End Sub

> > > Private Sub UserControl_Show()
> > >   Dim tblSource As Object, IntLoop As Double ', cnn As
adodb.Connection

> > >   ucHeight = UserControl.Height
> > >   If Ambient.UserMode Then
> > >     'Set cnn = New Recordset
> > >     If m_BoundField = "" Then m_BoundField = m_RowField
> > >     If m_RowSource.Recordsets(m_RowMember).State = 1 Then
> > > m_RowSource.Recordsets(m_RowMember).Close
> > >     m_RowSource.Recordsets(m_RowMember).Open
> > >     Set tblSource = m_RowSource.Recordsets(m_RowMember)
> > >     ReDim aryDataList(0 To tblSource.RecordCount, 0 To 1)
> > >     For IntLoop = 0 To tblSource.RecordCount
> > >       aryDataList(IntLoop, 0) = tblSource.Fields(m_RowField)
> > >       aryDataList(IntLoop, 1) = tblSource.Fields(m_BoundField)
> > >       lstDropList.AddItem tblSource.Fields(m_RowField)
> > >       tblSource.MoveNext
> > >       If tblSource.EOF Then Exit For
> > >     Next IntLoop
> > >   End If
> > > End Sub

> > > 'Write property values to storage
> > > Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
> > >     Call PropBag.WriteProperty("RowSource", m_RowSource, Nothing)
> > > End Sub



> > > > Post your code. Are you using Property Set instead of Property Let?
If
> > > > passing objects, you need Set... not Let

> > > > --
> > > > Ken Halter - MS-MVP-VB - Please keep it in the groups..
> > > > http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
> > > > http://www.vbsight.com/TBGDialogCTL.htm


> > > > > I'm creating an ActiveX control, and I want to pass the .RowSource
> > > > property
> > > > > just like in the DataCombo control, but it won't except the
object,
> and
> > > I
> > > > > don't know how to reference the dataenvironment using a string.
Can
> > > > anyont
> > > > > tell me how to do this?

> > > > > Dan



Fri, 13 May 2005 00:43:42 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Noone Responded, Still need Help!!!

2. Need Help with Access table - pls respond

3. NoOne want to Help me?

4. Looking for tool to make AVI files from JPG stills

5. Creating time-lapse AVI movie from SNAPPY stills?

6. create fog on a stills picture

7. Pulling PC Cam stills with an API

8. Using MAPI, need to respond to Logon

9. I can't believe noone knows this?!?!?

10. I can't believe noone knows this?!?!?

11. Noone can answer this

12. Noone likes newbies??

 

 
Powered by phpBB® Forum Software