I’ve never worked with arrays before and I think they are the way to go for this problem. I have a 15Rx4C table on a PartList form. The 1st column contains checkbox fields, (“C_1”, “C_2”, etc.) and the next 3 columns are PartName_1, PartNum_1 and PartCost_1 then PartName_2, PartNum_2 and PartCost_2, etc. I would like for the user to select whichever parts they serviced and then click a button to compose a response doc that includes the name, number and cost of each part selected IN order. Meaning, I’ve gotten it to work (sort of) using script that queries every field individually. However, the code is 2 pages long. Furthermore, the selected parts are copied to the response doc in the same order as the PartList doc. In other words, if they select parts 1, 5 and 10, then on the response doc, Row 1 has part 1, then 3 blank rows then part 5 is in the 5th row, etc. I’m pretty sure I could eliminate 90% of the code by using arrays. I’ve been over and over the arrays’ section in the Help and I know I need to use a dynamic array. So far, I have:
Dim CurrDoc as NotesUIDocument
dim MachDoc as NotesDocument
Dim PartNames () As String
Dim ci As String
Set CurrDoc…
Set MachDoc = CurrDoc.document
For counter% = 1 To ??
ci = Cstr(counter%)
If CurrDoc.FieldGetText(“C_” + ci) <> “” Then
PartNames(counter%-1) = CurrDoc.Part_ + ci
End If
Next
Please don’t laugh; I’m sure this is not even close! But I’ve been reading about arrays for a couple of hours and I don’t feel I’m making any progress. I can’t even figure out how to get the upper bound of the array! ANY help is much appreciated!
BTW…Does anyone know of any good tutorials or a good book on the subject?