Microsoft
Software
Hardware
Network
Question : Utilizing array gleamed from GetRows method in Access VBA
Hi. I am using the code below to gather the IDs of the fields where the field 'Invoiced" is checked.
This creates a two dimensional array. I need to use each of the values held in this array but am not sure how. For instance if I use MsgBox UBound(MyID) when there are three values I get 1 returned which doesn't make sense
Dim db As Database
Dim rs As dao.Recordset
Dim MyIds As Variant
Set db = CurrentDb
Set rs = db.OpenRecordset("Select ID from [Room Bookings] where Invoiced = true")
'You might try .MoveLast and .MoveFirst to insure the recordset is filled whe using the GetRows method below
rs.MoveLast
rs.MoveFirst
'/note I also use an arbitrarily large number instead of .Recordcount
MyIds = rs.GetRows(999999)
rs.Close
Set rs = Nothing
Set db = Nothing
Answer : Utilizing array gleamed from GetRows method in Access VBA
It is a 2d array (0,0) - (0, recordcount-1)
So
MsgBox UBound(MyIds, 2)
Will tell you the ubound of the 2nd dimension.
Random Solutions
ActiveSync Mobile Not Working on SBS 2003 Virtualized in ESX 4.0
How to execute Internet Explore page silently
Where is Outlook Express inbox.dbx file?
WScript: Retry on HTTP GET Connection Timeout
CSS IE7 quirky behavior - One word per line
Active Directory - specify nearest logon server for a remote site without a local DC
2203 error when installing office 2007 on vista
ASA 5505 Can VPN but cannot ping/connect to server or firewall.
Internal DNS Issue: Not consistently resolving internal domains.
unlock jailbroken iphone 3GS 3.1.3 model 5.12.01