Question

  • Creator
    Topic
  • #2265968

    How do I use the Active X UpDown Control (Comct232) in Access 2000 Forms?

    Locked

    by silverag_2 ·

    Never used it before. Not immediatly obvious. Need to add this type of control to a form.

    Range of values betwen 1-999
    default null on new record but ‘on-enter’ or ‘on-click’ the value defaults to mid range say 500 and then up & down to select the value .
    The Selected Value will need to be stored in the corresponding field / Data Source.

    I alreadt have the ‘UpDown’ Control on the form and have positioned a txtBox beside it…so how do I get them to work together?…

All Answers

  • Author
    Replies
    • #2577526

      Clarifications

      by silverag_2 ·

      In reply to How do I use the Active X UpDown Control (Comct232) in Access 2000 Forms?

      Clarifications

    • #2470850

      UpDown control usage

      by hfeddema ·

      In reply to How do I use the Active X UpDown Control (Comct232) in Access 2000 Forms?

      Here is some code:

      Private Sub ocxUpDown_DownClick()
      ‘Created by Helen Feddema 15-Oct-2007
      ‘Last modified 15-Oct-2007

      On Error GoTo ErrorHandler

      If IsDate(Me![txtPicnicDate].Value) = True Then
      dtePicnicOriginal = CDate(Me![txtPicnicDate].Value)
      dtePicnicNew = DateAdd(“d”, -1, dtePicnicOriginal)
      Me![txtPicnicDate].Value = dtePicnicNew
      End If

      ErrorHandlerExit:
      Exit Sub

      ErrorHandler:
      MsgBox “Error No: ” & Err.Number & “; Description: ” & _
      Err.Description
      Resume ErrorHandlerExit

      End Sub

      Private Sub ocxUpDown_UpClick()
      ‘Created by Helen Feddema 15-Oct-2007
      ‘Last modified 15-Oct-2007

      On Error GoTo ErrorHandler

      If IsDate(Me![txtPicnicDate].Value) = True Then
      dtePicnicOriginal = CDate(Me![txtPicnicDate].Value)
      dtePicnicNew = DateAdd(“d”, 1, dtePicnicOriginal)
      Me![txtPicnicDate].Value = dtePicnicNew
      End If

      ErrorHandlerExit:
      Exit Sub

      ErrorHandler:
      MsgBox “Error No: ” & Err.Number & “; Description: ” & _
      Err.Description
      Resume ErrorHandlerExit

      End Sub

      I am working on an Access Archon article on this topic — see my Web site for the article (http://www.helenfeddema.com)

Viewing 1 reply thread