I am trying to populate a list box ona form with data in a table. I am new to Access VBA and am not able to do it. Following is the snapshot of my code. Could somebody please look into it tell me where am I going wrong and wht shld I change. Any help would be sincerely appreciated.
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Load()
- Dim strSQL As String
- Dim strcustomername As String
- Dim rstLoans As DAO.Recordset
- Dim dbase As DAO.Database
- 'strcustomername = txtorderno.Value
- Set rstLoans = dbase.OpenRecordset("MASTERRECORD")
- 'Set rstLoans = dbase.OpenRecordset("MASTERRECORD", dbOpenCDO)
- SecuritiesList.RowSource = ""
- 'strSQL = "SELECTtblorder.orderno,tblorder.ProductID1,tblorde r. [Clothingtype1]"
- 'strSQL = strSQL & "FROM tblorder;"
- strSQL = "SELECT * FROM [MASTERRECORD]"
- Me.SecuritiesList.RowSource = strSQL
- End Sub
RB