I have the following arrary declared and the values it receives:
I have a Data Entry Form which will accept the above given 10 values for NV vehicles. The FORM
has a Command Button with caption NEXT. I want to know that after entering values and pressing
the NEXT button, the first array gets filled, but will the program wait on the field to enter the
values or the FOR...NEXT loop will finish putting the same values from the Text Boxes.
Later if the code successfully accepts values for NV vehicles, I have to print them as well.
The above accepted values will be used to fill the bill, so I need to determine that after printing
first bill the FOR...NEXT loop should retrieve values for second bill and then print it.
The printing will be automated for NV bills.
Suggest any efficient approach.
Code:
Option Explicit
Dim NV
Private Sub cmdNext_Click()
Dim VehicleArray
ReDim VehicleArray(NV, 10)
For i = 0 To NV
Call ValidateFields
VehicleArray(i, 0) = chkC.value
VehicleArray(i, 1) = chkB.value
VehicleArray(i, 2) = txtPH.Text
VehicleArray(i, 3) = txtVRN.Text
VehicleArray(i, 4) = Val(txtNoV.Text)
VehicleArray(i, 5) = txtVID.Text
VehicleArray(i, 6) = Val(txtV12I.Text)
VehicleArray(i, 7) = Val(txtV12S.Text)
VehicleArray(i, 8) = Val(txtV12O.Text)
VehicleArray(i, 9) = Val(txtC12I.Text)
VehicleArray(i, 10) = Val(txtC12S.Text)
Next
End Sub
I have a Data Entry Form which will accept the above given 10 values for NV vehicles. The FORM
has a Command Button with caption NEXT. I want to know that after entering values and pressing
the NEXT button, the first array gets filled, but will the program wait on the field to enter the
values or the FOR...NEXT loop will finish putting the same values from the Text Boxes.
Later if the code successfully accepts values for NV vehicles, I have to print them as well.
The above accepted values will be used to fill the bill, so I need to determine that after printing
first bill the FOR...NEXT loop should retrieve values for second bill and then print it.
The printing will be automated for NV bills.
Suggest any efficient approach.