ms-access


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!

Related Links

MS Access Dropdown List/Combo Box
How to communicate between two instances of open MDB with same form?
In Access 2007 CSV Export: Disable Scientific Notation
How do you format date fields of a Union Query in MS Access?
Porting MS Access application
automatically query and convert access db table to excel using vbs
Preserving linked tables for Access DBs in same folder when the folder changes
Disable warning: You copied a large amount of data onto the clipboard
How to get the name of Constraint?
Specify mdw file in embedded connection string to another Jet mdb: possible?
Validation Problem in vba text box
suppress write conflict message in Access VBA
How do I use a Checkbox on a form to add a record into a subform in Microsoft Office Access?
How to refresh linked tables in an Access mdb when ODBC changes
Query by month from date field
Parsing a web form in to a data table

Categories

HOME
sendgrid
client
vbscript
gerrit
stock
platform-builder
adb
sqlite-net-extensions
jira
cmd
infragistics
microservices
v8
umd
icloud
angular-ui-bootstrap
windows-server
ios-charts
portia
synchronization
maude-system
modelica
remote-access
fortumo
quartz-scheduler
netflix
worldwind
windows-7-x64
reactive-cocoa
immutable.js
opencover
csrf-protection
kudan
lcd
crosstab
buildbot
qhull
url-scheme
greendao
fifo
code-contracts
protovis
plsql-psp
event-driven
unspecified
sqlite2
azure-ml
cookiecutter-django
core-plot
elmah
eigenvalue
total-commander
sencha-touch-2.3
angular-resource
dds
powercli
mplayer
nodebb
pg-dump
flutterwave
smart-table
fuzzy-search
pickadate
hexdump
tform
two-factor-authentication
cloudbees
pervasive-sql
cyclomatic-complexity
comobject
ibaction
pretty-print
notify
npapi
network-interface
cctv
html-helper
googlemock
jubula
jboss-weld
geos
.aspxauth
dexterity
batterylevel
drools-planner
automount
genshi
tomcat-valve
servicehost
gallio
mozilla-prism
preference
nsviewanimation
vc90
webkit.net
libs
wsdl.exe
document-conversion

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App