I have a database for a motor bike racing club. There will be a number of events (meetings) during the year and I think I have set these up properly. Many reports will be necessary for each event/meeting eg Riders Details, sidecar entrants details, costings, scrutineers etc. and thewe will be up to 10 races per meeting
I would like to be able to choose a particular event/meeting and have it be the default event for all reports/queries till changed eg All reports etc will be for Eastern Creek Raceway, meeting 2 Round 1 until I tell it otherwise. I envisage this data being part of the queries needed to produce the reports etc but dont know how to do this – Any assistance greatly appreciated
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
‘Global’ Event (2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » ‘Global’ Event (2000)
- This topic has 16 replies, 2 voices, and was last updated 21 years, 1 month ago.
AuthorTopicWSstevecox4444
AskWoody LoungerFebruary 22, 2004 at 9:47 pm #401193Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody LoungerFebruary 22, 2004 at 10:03 pm #788469Assuming that you have a unique ID for each event, and that this is a number (Iong integer), you could do something like this:
- In a standard module (the type you create by clicking New in the Modules section of the database window), enter the following code:
Public DefaultEventID As Long
Public Sub SetDefaultEventID()
DefaultEventID = Val(InputBox(“Enter default Event ID”))
End SubPublic Function GetDefaultEventID() As Long
GetDefaultEventID = DefaultEventID
End Function - In queries that should return only data for the default event, set the criteria for the event ID field to
GetDefaultEventID()
- To prompt the user for another default event, run SetDefaultEventID, or (more user-friendly) create a form for this.
[/list]HTH
- In a standard module (the type you create by clicking New in the Modules section of the database window), enter the following code:
-
WSstevecox4444
AskWoody Lounger
-
-
WSstevecox4444
AskWoody Lounger -
WSstevecox4444
AskWoody LoungerApril 6, 2004 at 4:50 am #810217Hans – havent touched this for a while but I must be doing something wrong.
I created the module as instructed with slight changes to reflect me using MeetingID rather than EventID in my Tables
The module is :
Option Compare DatabasePublic DefaultMeetingID As Long
Public Sub SetDefaultMeetingID()
DefaultMeetingID = Val(InputBox(“Enter default Meeting ID”))
End SubPublic Function GetDefaultMeetingID() As Long
GetDefaultMeetingID = DefaultMeetingID
End FunctionThis has a heading on the module screen (see how out of depth I am – I’m not even sure of the terms) of General on the left and GetDefaultMeetingID on the right
I’m then lost as to what to do from here. If I open up the modules section of Access and double click on the module, it opens up this module and takes me to just after the end function section.
I then tied the module to a macro that does nothing but OpenModule using the getmeetingdefaultid module, in the hope I could link the macro to a button on a form – Seems to do nothing but take me to the end of the module and leave me in “module edit mode”. My meetingID field is an autonumber if that makes any differenceI’m sure this is something simple like me formatting something wrongly but I cant see where its wrong
Appreciate any helpSteve
-
WSHansV
AskWoody LoungerApril 6, 2004 at 6:50 am #810386The dropdown in the top left corner of a module window shows the object to which the code containing the insertion point belongs. Since the code you created does not belong to a particular object, this dropdown displays “General”. The dropdown in the top right corner shows the name of the procedure or function containing the insertion point.
You don’t need the macro; as you found, it won’t do anything useful.
If you want the user to be able to enter the new default Meeting ID, you must create a form for it. Place a command button on the form, and call SetDefaultMeetingID in the On Click code of this command button. Say that the command button is named cmdNewID:
– With the form in design view, select cmdNewID
– Activate the Event tab of the Properties window.
– Click in the On Click event.
– Select [Event Procedure] from the dropdown list.
– Click the … to the right of the dropdown arrow.
– Make the code look like this:Private Sub cmdNewID_Click()
SetDefaultMeetingID
End SubTo use the default meeting ID, create a query based on the table or tables you need. Include MeetingID in the query grid, and enter
GetDefaultMeetingID()
in the Criteria line for this column. This will make the query return only records with the specified MeetingID. Use the query as record source for forms and reports.
-
WSstevecox4444
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSstevecox4444
AskWoody Lounger -
WSstevecox4444
AskWoody Lounger -
WSHansV
AskWoody Lounger
-
-
-
WSstevecox4444
AskWoody Lounger
-
WSHansV
AskWoody LoungerApril 6, 2004 at 6:50 am #810387The dropdown in the top left corner of a module window shows the object to which the code containing the insertion point belongs. Since the code you created does not belong to a particular object, this dropdown displays “General”. The dropdown in the top right corner shows the name of the procedure or function containing the insertion point.
You don’t need the macro; as you found, it won’t do anything useful.
If you want the user to be able to enter the new default Meeting ID, you must create a form for it. Place a command button on the form, and call SetDefaultMeetingID in the On Click code of this command button. Say that the command button is named cmdNewID:
– With the form in design view, select cmdNewID
– Activate the Event tab of the Properties window.
– Click in the On Click event.
– Select [Event Procedure] from the dropdown list.
– Click the … to the right of the dropdown arrow.
– Make the code look like this:Private Sub cmdNewID_Click()
SetDefaultMeetingID
End SubTo use the default meeting ID, create a query based on the table or tables you need. Include MeetingID in the query grid, and enter
GetDefaultMeetingID()
in the Criteria line for this column. This will make the query return only records with the specified MeetingID. Use the query as record source for forms and reports.
WSstevecox4444
AskWoody LoungerApril 6, 2004 at 4:50 am #810218Hans – havent touched this for a while but I must be doing something wrong.
I created the module as instructed with slight changes to reflect me using MeetingID rather than EventID in my Tables
The module is :
Option Compare DatabasePublic DefaultMeetingID As Long
Public Sub SetDefaultMeetingID()
DefaultMeetingID = Val(InputBox(“Enter default Meeting ID”))
End SubPublic Function GetDefaultMeetingID() As Long
GetDefaultMeetingID = DefaultMeetingID
End FunctionThis has a heading on the module screen (see how out of depth I am – I’m not even sure of the terms) of General on the left and GetDefaultMeetingID on the right
I’m then lost as to what to do from here. If I open up the modules section of Access and double click on the module, it opens up this module and takes me to just after the end function section.
I then tied the module to a macro that does nothing but OpenModule using the getmeetingdefaultid module, in the hope I could link the macro to a button on a form – Seems to do nothing but take me to the end of the module and leave me in “module edit mode”. My meetingID field is an autonumber if that makes any differenceI’m sure this is something simple like me formatting something wrongly but I cant see where its wrong
Appreciate any helpSteve
WSHansV
AskWoody LoungerFebruary 22, 2004 at 10:03 pm #788470Assuming that you have a unique ID for each event, and that this is a number (Iong integer), you could do something like this:
- In a standard module (the type you create by clicking New in the Modules section of the database window), enter the following code:
Public DefaultEventID As Long
Public Sub SetDefaultEventID()
DefaultEventID = Val(InputBox(“Enter default Event ID”))
End SubPublic Function GetDefaultEventID() As Long
GetDefaultEventID = DefaultEventID
End Function - In queries that should return only data for the default event, set the criteria for the event ID field to
GetDefaultEventID()
- To prompt the user for another default event, run SetDefaultEventID, or (more user-friendly) create a form for this.
[/list]HTH
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 hours, 10 minutes ago -
Office 2021 Perpetual for Mac
by
rebop2020
3 hours, 22 minutes ago -
False error message from eMClient (Awaiting moderation)
by
WSSebastian42
3 hours, 53 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
6 hours, 54 minutes ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
7 hours, 16 minutes ago -
Outdated Laptop
by
jdamkeene
12 hours, 19 minutes ago -
Updating Keepass2Android
by
CBFPD-Chief115
17 hours, 44 minutes ago -
Another big Microsoft layoff
by
Charlie
17 hours, 24 minutes ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
20 minutes ago -
May 2025 updates are out
by
Susan Bradley
8 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
23 hours, 28 minutes ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
23 hours, 30 minutes ago -
Drivers suggested via Windows Update
by
Tex265
23 hours, 21 minutes ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
21 hours, 5 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
1 day, 6 hours ago -
Apple releases 18.5
by
Susan Bradley
1 day ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
1 day, 7 hours ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
1 day, 8 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
15 hours, 40 minutes ago -
No HP software folders
by
fpefpe
1 day, 16 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
13 hours, 24 minutes ago -
Stay connected anywhere
by
Peter Deegan
1 day, 21 hours ago -
Copilot, under the table
by
Will Fastie
1 day, 12 hours ago -
The Windows experience
by
Will Fastie
2 days, 3 hours ago -
A tale of two operating systems
by
Susan Bradley
7 hours, 55 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
2 days, 9 hours ago -
Where’s the cache today?
by
Up2you2
3 days ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
2 days, 17 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
1 day, 17 hours ago -
Blocking Search (on task bar) from going to web
by
HenryW
19 hours, 42 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.