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!
Generate an ID from different column choices in Microsoft Access 2013
MSACCESS query: not part of an aggregate function
pdi spoon ms-access concat
iff command issue in MS Access
How to display the maximum value from one column in a listbox, in a textbox on the same form
access 2010 writing SQL statements
Add Working Days to Start Date to Create End Date (including Bank Holiday)
ms access input mask MM/DD/YYYY
'Microsoft.ACE.OLEDB.12.0' provider is not registered -but it is
How do I run this query?
Sending Email with Late Binding Error Through VBA
Microsoft Access 2010 VB Script and Query
Delete query for multiple tables
write an Access query have more than 1 SELECT statement
MS Access - Rank on TEXT fields
Creating / Attaching module in Access database at runtime from VB6 application