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

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)

Categories

HOME
atom-editor
pypi
heroku
reserved
google-api-php-client
angular-material
layout
session
fme
win32gui
callback
baqend
slick-slider
awesome-wm
kibana-4
circuit
caml
transformation
evopdf
hammerspoon
numerical-methods
buildbot
apache-commons-io
uninstall
phpfox
fopen
wtx
msys2
large-file-upload
libssl
gsmcomm
delicious-api
bpel
flink-streaming
pdb
environment-modules
picasso
wixsharp
gesture
code-search-engine
streamreader
azure-ml
android-tabhost
quadratic-programming
sencha-touch-2.3
dotcover
parentheses
jquery-validate
drupal-6
ifs
zendesk-app
sonarlint-vs
account-kit
crosswalk-runtime
topbeat
root-framework
ableton-live
libpng
underscore.js-templating
fuzzy-search
gstreamer-0.10
contact-list
simplewebrtc
superstack
wapiti
freelancer.com-api
xna-4.0
r-tree
jms2
collapse
spidermonkey
mdt
rdtsc
xcode-6.2
typeof
elliptic-curve
funcunit
jquery-layout
reactfx
android-2.2-froyo
oracle-warehouse-builder
algebraic-data-types
c18
apc
dataadapter
factory-method
unc
gil
ocx
chrono
wse3.0
bubble-chart
punbb
hgsubversion
hamachi
f#-powerpack
netbeans-7.1
mongomapper
jmock
ext3
castle-monorail
genealogy
dbisam
ntvdm.exe

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