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

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

Categories

HOME
image
wso2
amazon-ec2
keycloak
urbancode
google-api-php-client
nullpointerexception
iot
microservices
ip
ravendb
onelogin
uber-api
maude-system
metatrader4
node-pdfkit
u-sql
qt-creator
hapi
percona
invantive-sql
reactcsstransitiongroup
errorlevel
web-sql
sylius
dcevm
restful-authentication
intel-pin
maxmind
file-rename
twilio-api
mozilla
nssegmentedcontrol
jmonkeyengine
suricata
disassembling
serve
hockeyapp
libvpx
eclipse-scout
outlook-api
logfiles
dds
python-c-api
paxos
ionicons
darcs
imanage
spring-cache
hittest
azure-sdk
probability-density
elements
autorest
flash-cs5
moveit
apachebench
iad
vhd
xna-4.0
thredds
marching-cubes
createprocessasuser
processmodel
p2
fscommand
modalpopup
pick
document-classification
oracle-warehouse-builder
shellexecute
qt-faststart
google-email-migration
twrequest
dbproviderfactories
nsmanagedobject
removeclass
semantic-diff
work-stealing
qt-jambi
fluent-interface
dentrix
simpletest

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