listbox event

  • Thread starter Thread starter Judy
  • Start date Start date
J

Judy

Is there a way to create a list box with names of a table, click the name,
and it would immediately bring up all records in a subform relating to that
name?
 
Judy,

Create a bound form that displays all records from the table. Then in the
DblClick event for the listbox, add the following pseudo-code:
DoCmd.OpenForm "frmMyForm", , , "TableName = """ & Me!lstTables &
""""

The RowSource property of your list should be as follows:
SELECT [Name]
FROM MSysObjects
WHERE [Type] = 1 AND Flags = 0
ORDER BY [Name]

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Back
Top