I created a form based on a table, the TASK text box on the form is to enter text string. When user presses refresh records, the text typed in the TASK text box should be transferred into the first blank field (starting from field 13 )on that record in the table.
The program looks for the blank field starting from field 13, if 13 is blank, then the text will be inserted into Field13, if Field13 is not blank, it should check Field14, and so on. The total fields can be as long as Field 40.
The program below doesn’t work. Your help will be greatly appreciated.
Private Sub Text18_AfterUpdate()
Dim i As Integer
Dim fieldArray(1 To 40) As Field
For i = 13 To 40
If fieldArray(i).Value = "" Then
fieldArray(i).Value = Text18.Text
Exit For
End If
Next
End Sub
The program looks for the blank field starting from field 13, if 13 is blank, then the text will be inserted into Field13, if Field13 is not blank, it should check Field14, and so on. The total fields can be as long as Field 40.
The program below doesn’t work. Your help will be greatly appreciated.
Private Sub Text18_AfterUpdate()
Dim i As Integer
Dim fieldArray(1 To 40) As Field
For i = 13 To 40
If fieldArray(i).Value = "" Then
fieldArray(i).Value = Text18.Text
Exit For
End If
Next
End Sub