HELLO GUYS, IN RESPONSE TO:
I would like to know how to link items on a list box to say a query, form or a report. I have a list box with items like: Search - By Customer, By Company Name by Product. I would specifically like to know how to link these items on the list box to the related forms or queries
The list box located on the main siwtchboard form would have 4 sections/headings, Orders, Search, View and Reports and would be arranged in the following order:
Order
Search By Customer name
By Company Name
By Channel Partner
View
Products
Payment Methods
Shipping Methods
Employees
Reports
Sales By Customer
Sales By Employee
Sales By Product Sales
By Channel Partner
everything in the list box with the exception of the headings would be linked to respective forms or reports.
I WAS GIVEN THE FOLLOWING:
Create a table named "tblMenuItems" with the following columns:
Field Name Data Type Description
---------- --------- -----------
Sequence Number(Integer) <- Primary key
MenuItem Text Text to show in list box
ItemType Text(1) F=Form, R=Report
ItemName Text Form/Report name
You could enter this information directly into the list box if you wanted, but keeping it in a table makes it easier to make changes later. The Sequence field lets you change the order of items in the list, or insert new items in the middle.
In your list box control (let's call it lstMenu), set the following properties:
Row Source Type: Table/Query
Row Source: tblMenuItems
Column Count: 4
Column Width: 0;;0;0
Bound Column: 1
In lstMenu's DoubleClick event, use code like the following to open the form or report:
Private Sub lstMenu_DoubleClick()
Dim strType As String, strName As String
With lstMenu
strType = .Column(2, .ListIndex)
strName = .Column(3, .ListIndex)
Select Case strType
Case "F"
DoCmd.OpenForm strName
Case "R"
DoCmd.OpenReport strName
End Select
End With
End Sub
BEING A NOVICE IN V.B:
WITH REGARDS TO THE LAST BIT CONCERNING THE EVENT PROCEDURE, WOULD I HAVE TO CREATE THE SAME PROCEDURE FOR EACH ITEM IN THE LIST BOX?
I would like to know how to link items on a list box to say a query, form or a report. I have a list box with items like: Search - By Customer, By Company Name by Product. I would specifically like to know how to link these items on the list box to the related forms or queries
The list box located on the main siwtchboard form would have 4 sections/headings, Orders, Search, View and Reports and would be arranged in the following order:
Order
Search By Customer name
By Company Name
By Channel Partner
View
Products
Payment Methods
Shipping Methods
Employees
Reports
Sales By Customer
Sales By Employee
Sales By Product Sales
By Channel Partner
everything in the list box with the exception of the headings would be linked to respective forms or reports.
I WAS GIVEN THE FOLLOWING:
Create a table named "tblMenuItems" with the following columns:
Field Name Data Type Description
---------- --------- -----------
Sequence Number(Integer) <- Primary key
MenuItem Text Text to show in list box
ItemType Text(1) F=Form, R=Report
ItemName Text Form/Report name
You could enter this information directly into the list box if you wanted, but keeping it in a table makes it easier to make changes later. The Sequence field lets you change the order of items in the list, or insert new items in the middle.
In your list box control (let's call it lstMenu), set the following properties:
Row Source Type: Table/Query
Row Source: tblMenuItems
Column Count: 4
Column Width: 0;;0;0
Bound Column: 1
In lstMenu's DoubleClick event, use code like the following to open the form or report:
Private Sub lstMenu_DoubleClick()
Dim strType As String, strName As String
With lstMenu
strType = .Column(2, .ListIndex)
strName = .Column(3, .ListIndex)
Select Case strType
Case "F"
DoCmd.OpenForm strName
Case "R"
DoCmd.OpenReport strName
End Select
End With
End Sub
BEING A NOVICE IN V.B:
WITH REGARDS TO THE LAST BIT CONCERNING THE EVENT PROCEDURE, WOULD I HAVE TO CREATE THE SAME PROCEDURE FOR EACH ITEM IN THE LIST BOX?