Hello guys,
I am trying to populate my datagrid from a selection from a listbox, but instead of getting one row of info or rows, I am getting one column from the database.
Here is my code:
I know it something simple that I am missing, but I cant find what it is.Code:Private Sub lstRadioSerials_Click() If lstRadioSerials.ListIndex < -1 Then strRadioSerialResults = lstRadioSerials.List(lstRadioSerials.ListIndex) strSQL = "SELECT RadioInfo.SERIAL_NO,RadioInfo.COC_ID,RadioInfo.MFG,RadioInfo.BATTS_ISSUED,RadioInfo.DateIssued," _ & "RadioInfo.ExpReturnDate,RadioInfo.ReturnDate,RadioInfo.ENTITY,RadioInfo.Phone,RadioInfo.RecvdBy,RadioInfo.CNTY_ID," _ & "RadioInfo.MARCS_ID,RadioInfo.DEL_ID,RadioInfo.MODEL_NO,RadioInfo.MODEL_NAME,RadioInfo.Comments" _ & "FROM RadioInfo WHERE RadioInfo.SERIAL_NO = '" & strRadioSerialResults & "'" rs.Close rs.CursorLocation = adUseClient rs.Open strSQL, DBConn, adOpenDynamic, adLockOptimistic End If Set Me.dgStandardQuery.DataSource = rs End Sub
Any help would be appreciated.




Reply With Quote