Skip to main content
InSource Solutions

TN IT134 InTouch AlmDBViewCtrl: Adding time and date selection

insource logo large.jpg



Want to use the AlmDBViewCtrl in InTouch to look at Alarms, but want to specify time and date for the Start and End times.


  • Author: Dillon Perera
  • Published: 05/29/2015
  • Applies to: InTouch, with AlmDBViewCtrl ActiveX




  1. Create a new Window.
  2. Go to Wizards > ActiveX and add an AlarmDBView Control to your window.
  3. Double click on the AlarmDBView control
    1. On the Database tab enter the information for where your Alarm database is.
    2. On the Selection tab select the default time frame that you want to show (I think you wanted to set this to last 3 days)
    3. On the Control Name tab, note the name of the control as we’ll need to use this in scripts.  (Mine is named AlmDBViewCtrl5)
  4. Go to Special Menu > Configure > Wizard/ActiveX installation
    1. Go to the ActiveX Control Installation tab
    2. The list at the bottom of the screen lists all of the ActiveX’s installed on your PC.  This list will be different based on what software you have installed.  From the list I selected the “Microsoft Date and Time Picker Control, version 6.0”.  Once selected hit Install, to add it to the top of the list.
      Note: Because these controls are not Wonderware controls, we can’t guarantee they’ll work, and we don’t have a lot of documentation on them.  The Microsoft controls you can usually find a lot of information online about though.


  5. Go to Wizards, and in the ActiveX tab you should now see DTPicker.  Add four of these to the screen, one for start Date and Time, one for end Date and Time.  Also add a button that will be used for refreshing the control with the new dates.
    1. Here is what my window looks like:

  6. Double click on the DateTime pickers to bring up the Properties window.
    1. On the ControlName tab of each, name them DTPicker1Date, DTPicker1Time, DTPicker2Date, DTPicker2Time.
    2. On the General Tab for the two Date fields, set the Format to 1-dtpShortDate.  For the two Time Fields, set the Format to 2-dtpTime.
    3. Once you’ve done this it’ll look like this (Times shown now, instead of 4 dates).

  7. Double click the Refresh button, and add the following action script: