Richie said:
i found this code but is says i dont have permission to read in MSysobjects
how can i do it??
"SELECT MSysObjects.Name FROM MSysObjects " & _
"Where (((MSysObjects.Flags) = 0) And ((MSysObjects.Type) =
1)) " & _
"ORDER BY MSysObjects.Name"
Try this code in a form's On Load event to fill a list box with its
rowsource type set to value list. If you still get an error, you'll need to
check your permissions:
Private Sub Form_Load()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim i As Integer
Dim strTableNames
Set db = CurrentDb
For i = 0 To db.TableDefs.Count - 1
If Left(db.TableDefs(i).Name, 4) <> "Msys" Then
strTableNames = strTableNames & db.TableDefs(i).Name & ";"
End If
Next i
Me.List0.RowSource = strTableNames 'Fill Listbox
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access