Walk through table in MS Access VBA
I need to walk through the rows of a table and test each in a Select Case. I have looked at For Each but can't determine what the syntax would be.
I don't really write in VBA anymore and I'm stumped.
Thanks.
Web Development
I need to walk through the rows of a table and test each in a Select Case. I have looked at For Each but can't determine what the syntax would be.
I don't really write in VBA anymore and I'm stumped.
Thanks.
by john_wills
I don't know what yu're trying to do. Suppose that you want to test the rows for some value of X and return Y accordingly.
private Sub Whatever(XInVBA AS XType,YInVBA AS YType)
dim Finder as String
dim YHolder as RecordSet
Finder="SELECT Y FROM TheTable WHERE x=" & XInVBA & ";"
Set YHolder=CurrentDB().OpenRecordSet(Finder)
YHolder.MoveFirst
YInVBA=YHolder.Fields(0)
end sub
by hlc
by hlc
This discussion is closed to new replies.
Sort by Trending