Getting Started with Using NetView in your own Project

  1. Get the latest release of NetView
    1. Download from the DOWNLOADS tab.
  2. Prepare your project
    1. Copy the file NetView.mdb contained in the downloaded release-zip into the same directory as your project's mdb/accdb file.
    2. In the Visual Basic Editor, set a reference to NetView.mdb.
    3. Import the form [NetViewControl] into your database
  3. Use the Control in your form(s)
    1. Embed the form [NetViewControl] as a subform in your form
    2. In Form_Open of your form set the properties for the NetViewControl subform. Refer to the example below.

The code below shows how to setup NetView in the containing form's Load event. To set up databinding, adapt the places marked with ' TODO.
Remark: In the example MSysObjects is used as the record source just because this table is present in any database. Change this to fit your special record source
Private WithEvents MyNetView As NV_NetView


Private Sub Form_Open(Cancel As Integer)
   Set MyNetView = NetViewControl.Form.TheNetView
   With MyNetView
      ' Some cosmetics
      .BackColor = RGB(255, 255, 153)  ' light yellow
      .BorderColor = vbBlue
      ' The size of the world
      .Minimum1 = -100
      .Maximum1 = 100
      .Minimum2 = 1
      .Maximum2 = 11
      ' Setup databinding
      ' TODO: Provide your own datasource (SQL)
      .RecordSource = "SELECT * FROM MSysObjects"

      ' required - TODO: provide the name of your primary key field
      .BindItemBusinessIdTo "Id"
      ' TODO: To bind attributes to data, provide field names of your record source
      '       and remove the comment 
      .BindItemTextTo "Name"
'      .BindItemTextColorTo "ColorA"
'      .BindItemTipTextTo "MyTipText"
'      .BindItemBackColorTo "ColorB"
'      .BindItemBorderColorTo "ColorC"
'      .BindItemPosition1To "Pos1"
'      .BindItemExtent1To "Ext1"
'      .BindItemPosition2To "Pos2"
'      .BindItemExtent2To "Ext2"
   End With
End Sub

Private Sub Form_Load()
   MyNetView.Requery   ' Call this anywhere to update the control from the datasource
End Sub

Private Sub Form_Close()
   Set MyNetView = Nothing
End Sub

To find out about more options NetView gives you, check out Additional Things you might try


Last edited Oct 15, 2012 at 6:02 AM by Baula, version 23


No comments yet.