Thanks niceguymattx for pointing me in the right direction. I'm learning.
I think that I'm on the right track but it's not working. I'm getting an error that the varible at: ReDim Preserve aryCodeList(0, lngIndex) is not declared. I admit that Im new to this and following an example. I'm also unsure if I have the code in the right location. I want the drop-down list to populate on page load. Could you please advise?
Here is the code:
Private Sub Window_AfterActivate()
Dim conn As New ADODB.Connection
conn.Open "Provider=sqloledb;Data Source=localhost;Initial Catalog=BBTN;User Id=xxx;Password=xxx"
Dim RecordSet As New ADODB.RecordSet
RecordSet.Source = "select RMDNUMWK from SV00564"
Set RecordSet.ActiveConnection = conn
RecordSet.Open
If RecordSet.EOF = True Then GoTo BYE
Dim lngIndex As Long
lngIndex = -1
Do Until RecordSet.EOF
lngIndex = lngIndex + 1
ReDim Preserve aryCodeList(0, lngIndex)
aryCodeList(0, lngIndex) = grsPrimary.Fields("RMDNUMWK")
RecordSet.MoveNext
Loop
RecordSet.Close
invBegNum.Value = RecordSet
End Sub