Suncastle1
10-08-2008, 11:59 AM
I am relatively new to Aceess. Is there a way of producing, ona single page, a list of the queries that I have produced for a single database? I recently saw a work collegaue had done so with a customised list, all of which were actionable and brought up the queries on screen. Can anyone help?
Thanks
ajetrumpet
10-08-2008, 01:32 PM
you can start here:
http://www.access-programmers.co.uk/forums/showthread.php?t=141161
You can get tables from that code. If you want all the queries, and the fields found within them, change the code loop block to the following code: For Each qrydef In db.querydefs
If Not qrydef.Name Like "msys*" Then
If Not qrydef.Name Like "~tmp*" Then
If Not qrydef.Name = "DBdata" Then
Set rsLOOP = db.OpenRecordset(tbldef.Name)
For i = 0 To rsLOOP.Fields.Count - 1
Set fld = rsLOOP.Fields(i)
With rsNEW
.AddNew
!tablename = qrydef.Name
!FieldName = fld.Name
!FieldType = FieldType(fld.Type)
!FieldSize = fld.Size
.Update
End With
Next i
rsLOOP.Close
End If
End If
End If
Next qrydefalso add this declaration:dim qrydef as querydefall should be fine. If you only want query names, just eliminate some of the code that populates the field names and such.