EXCELLENT!!!! It all works perfectly! Thanks for the help, it was very much needed and is very much appreciated
The working solution.......basically copied from the link above
VB Code:
Sub selectAll() Dim conDatabase As ADODB.Connection Dim rs As New ADODB.Recordset Dim cmdCommand As New ADODB.Command Dim sql As String Dim valueString As String valueString = "" Set conDatabase = CurrentProject.Connection 'IS THIS CORRECT Set cmdCommand.ActiveConnection = conDatabase 'IS THIS CORRECT? cmdCommand.CommandType = adCmdText sql = "SELECT * FROM SIMs" cmdCommand.CommandText = sql Set rs = cmdCommand.Execute Do While Not rs.EOF valueString = "" valueString = rs.Fields("Network_Code").Value valueString = valueString + ", " + rs.Fields("SIM_No").Value MsgBox (valueString) rs.MoveNext Loop End Sub




Reply With Quote