CharlesWhiteman
Registered User.
- Local time
- Today, 21:49
- Joined
- Feb 26, 2007
- Messages
- 421
Hi, I have the following example of code I have previously used which loops through columns where a column is called "Page1", "Page2", Etc. Etc.
This is fine when the number of columns is fairly small. But in a new case I have 585 250 columns which may or may not contain some data which is the key.
Is there a better way say
If data exists in column do something and after that or of not move to the next column and do the same thing until there are no more columns?
This is fine when the number of columns is fairly small. But in a new case I have 585 250 columns which may or may not contain some data which is the key.
Is there a better way say
If data exists in column do something and after that or of not move to the next column and do the same thing until there are no more columns?
Code:
Dim rst As DAO.Recordset ' recordset for category data
' open the recordset for categories
Set rst = CurrentDb.QueryDefs!QryRMA.OpenRecordset
' loop through the rows in the recordset
rst.MoveFirst
Do Until rst.EOF
If Not IsNull(rst!Page1) Then
strClientID = (rst!ClientID)
strClientName = (rst!ClientName)
strDocDate = (rst!DocDate)
strDocDescription = (rst!DocDescription)
strInfoType = (rst!InfoType)
strFilePath = (rst!Page1)
funcP1
Else
End If
rst.MoveNext
Loop
' loop through the rows in the recordset
rst.MoveFirst
Do Until rst.EOF
If Not IsNull(rst!Page2) Then
strClientID = (rst!ClientID)
strClientName = (rst!ClientName)
strDocDate = (rst!DocDate)
strDocDescription = (rst!DocDescription)
strInfoType = (rst!InfoType)
strFilePath = (rst!Page2)
funcP2
Else
End If
rst.MoveNext
Loop