Using the SpinButton control
We also need to make changes to the SpinButton control for the Age textbox, since it is currently not functioning, or so it appears. The arrows on the SpinButton control do actually change values when we click on them, but this is not displayed anywhere. We can, therefore, not see the changing values. What we need to do is code an event for the spin button, so that whenever its value changes, it also changes the value of the textbox.
In this recipe, we will be using the SpinButton control.
Getting ready
Make sure that Controls.xlsm
is still open. New Record Entry Form should be visible, and both the project window and the properties window should be visible on the left of the VBA Editor.
How to do it…
We need to do the following:
- Double-click on the SpinButton control to open the code for the control. Add the following code:
Private Sub spnAge_Change() Â Â Â Â txtAge.Value = spnAge.Value End Sub
- Set parameters...