Question

Locked

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

By pieter_t ·
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?...

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

UpDown control usage

by hfeddema In reply to How do I use the Active X ...

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)

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums