Spin Box Control used on Continuous Form
Posted on 2005-02-26
I originally used an Access Form with a Default View of Continuous Forms. Within the design of the form, in
the Detail Section I placed a Combo Box. For the Combo Box I used a Row Source Type of a Value List and placed the accompanying values in the Row Source as 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15
The form has a Record Source of a States table. Thus, when I run the Form, it displays 50 rows forthe 50 states. For each row, the user can use the Combo Box to select values in the range of 1 to 15. This form works fine. However, I thought it could be improved upon. Instead of a Combo Box, I planned on switching to a Spin Box Control which I read about in a VBA For Dummies Programming Book.
I copied the Spin Box Control picture images off the web. Then I inserted these picture images of the Spin Box Controls onto the Detail Section of my Continuous Form as a substitute for the Combo Box. I placed a text box which would receive the values 0 to 15 (to the side of these spin box controls) and assigned the text box a default value of 0. Now when I run the continous form, I once again have 50 rows for the 50 states. However, when I click on the Spin Box Control Up or Down arrows, the values ONLY change on the 1st row. In other words, no matter which row I used to click on a Spin Box Control, the ONLY accompanying text box that changes values is the top row. Do you know how I can fix this problem ?
I proceeded to add the following lines of code into the
On Click Events for the Spin Box Controls Down and Up buttons.
Private Sub SpinDownBttnI_Click()
'Decrease Skip By 1 to a minimum of 0
If Me.IRAFS.Value > 0 Then
Me!IRAFS.Value = Me!IRAFS.Value - 1
Private Sub SpinUpBttnI_Click()
'Increase Skip By 1 to a maximum of 15
If Me.IRAFS.Value < 15 Then
Me!IRAFS.Value = Me!IRAFS.Value + 1