DCount("txtVenue","tblTrainingSession", "IsNull([txtVenue])")
I personally despise the idea of switchboards and instead of using them will
go with an alternative that might work for you.
I create a table USysMenuFunction with two fields, menu function and sort
order
0 Trailer Manifests
0 Trailer Dispatch
0 Load Lists
9 Quit
Then I create a list box on the Main Menu/Switchboard to display the menu
functions sorted by SORT ORDER then MENU FUNCTION. (The sort order field in
the table is used for a custom sort as opposed to alphabetica.)
In the onClick event of the list box, I have a sub that uses a select
statement to execute whatever code is associated with the menu function as
in.
Select [Forms]![frmMainMenu]![cboMenuFunctions]
Case "Trailer Manifests"
Case "Trailer Dispatch"
Case "Quit"
end select
This eliminates issues when you have a large number of menu options. You can
even add grouping if needed as in
100 -Accounting
101 Process Payments
102 Receive Payments
103 Maintain Accounts
199 Blank Space]
200 -Client Accounts
201 Create Order
202 View Order
203 Invoicing
Since the the Select Case works on the value in the list box, you simply
don't include a case for "-Accounting", "[Blank Space]", or "-Client
Accounts". The SORT ORDER field is then used to group the functions under
the headers.
In your scenario, this helps to save real estate because you can place the
list box into a TAB CONTROL with a tab for the menu options and one for the
statistics. Or just place the stats elsewhere on the form.
You can also expand this technique to control which users have access to
which options.
"ant1983" <(E-Mail Removed)> wrote in message
news

5F58B33-CFBD-4284-8DC8-(E-Mail Removed)...
> Hi,
>
> I have a table (tblTrainingSession) and amongst other fields there is a
> txtVenue field.
>
> Then i have a amongst all I forms a frmMainMenu. On this form i have all
> my
> buttons etc but i want to do a section on the forms of a glimpse of stats
> (so
> various ad-hoc things)
>
> One of the things i want to do is to do a count of the txtVenue field
> (Nulls
> only) in the tblTrainingSession. How do i do this?
>
> I thought i could add a txtbox to the frmMainMenu and then right-click and
> go to Expression Builder and build the following: "=
> [tblTrainingSession]![txtVenue] = Null"
>
> But that results in nothing!
LOL
>
> Ta!