Problems implementing basic VBA in Access 2007
I'm trying to write some code for my database to enable a dropdown box in a parameter prompt for a query, but it's doing nothing instead of it's intended purpose. This: Dropdown in Access 2007 parameter query has been the source of my inspiration. Though I seem to be unable to implement even the most basic VBA code: Private Sub cmdReset_Click() Me.cboSelectName = Null End Sub (Yes this is not all my code! Just one of the subs) On the relevant form, I have a button called "cmdReset", which has "[Event Procedure]" for the event "On-Click". I also have a dropdown box called "cboSelectName" on said form. Also I have tried closing the database, and making sure to enable macros when it starts. So essentially this code should make the value in the dropdown box null when I click the reset button. However it does nothing, it simply deselects the dropdown box. Can anyone help me with this one? I'm keen to start implementing some VBA in my database!
As suggested by Remou, the code wasn't even running. I figured out my problem - I had saved the code in a new module, rather than in the VBA code for my form. Once I shifted the code into the form object, the reset button worked. I've also now got some nifty code working with the actual "generate report" command. VBA really has the power to take your database to a whole new level!
Very slow subqueries when using “NOT IN”
Microsoft Access - Scrambling Totals
Selecting data from the start of every hour
MS Access Query - Use a parameter value as one of the selected records
How can I add a filter to my form based upon a joined table's columns that don't appear in the Select clause?
MS Access - Open database form from URL
How to insert “Entire” DAO recordset into a table with VBA
Passing a form and list box
Access VBA: Is there any way to get computer specs?
Microsoft Access DoCmd.TransferText additional column
MSAccess VBA ORDER BY not working on dynamic recordsource
Field Display Question
How to add new record to subform
Search value in MS Access from textbox
leagacy ms access database with some unreadable fields
subform display not updating (but its record count can be seen to be changing in vba)