ms-access


How to set initial selections of controls in a MS access report on its load?


I have a MS Access 2007 report which is based on a query that has some parameters that can be modified by selecting values in listboxes that are in the header of the report. The flow is as follows:
A user selects parameters in listboxes
A user clicks "generate" button. I have an OnClick event attached to it, which goes through all the listboxes, picks up their selections, puts together an SQL statement and sets it as source for the underlying MS Access query.
The only way I could find to properly refresh the report was to first do Me.Requery and then close and reopen the report. Just Me.Requery was not enough.
After the report is reopened, all the selections in the listboxes are lost. But I have them saved in a variable and I would be able to set them back, but I cannot find a suitable event.
I tried Report Load, Open, Current events - none of them worked. For Current event, I see that the selection gets set but then is deselected immediately. Could anybody suggest me what other event could I try or maybe a slight different approach all together?
Seems to me this one could be easier by giving the user a form with those list box controls, let her make her selections there, and then pass the selection criteria as the WhereCondition parameter to DoCmd.OpenReport.
From that page, the WhereCondition parameter is "A string expression that's a valid SQL WHERE clause without the word WHERE".

Related Links

Continuous form selection deselected on command button click
Microsoft Access remove part of string
How to get the GUID of a table in microsoft Access
is there TRUNCATE in Access?
A table value places a checkmark in a checkbox on a form
Can you change the default color for selected text in MS Access?
MsAccess Free text in dropdown
msaccess workgroup information file
Composite Key in MS Access 2003
Access 2007 response time
MS Access VBA DoCmd.ApplyFilter IsNull() evaluating false
Access 2010 Query pulling data that matches a label value
How to find broken queries in Access?
Hand Install of 64-bit MS Access ODBC drivers when 32-bit Office is present
How to insert values into an Access table's AutoNumber field?
java connecting to access database problem

Categories

HOME
wso2
deployment
magnific-popup
mfc
homebrew
mean-stack
jira
callback
ebean
networkx
upload
esper
slurm
gitpitch
dacpac
user-input
google-cloud-spanner
task
alpine
predix
swiftlint
mustache.php
javacv
fish
url-scheme
applozic
c++-amp
airconsole
usbserial
amazon-kinesis-kpl
nssegmentedcontrol
theano.scan
az-application-insights
android-fingerprint-api
ensembles
pdf-reactor
powershell-dsc
glew
firebase-admin
websphere-mq-fte
angular-resource
termination
strptime
paxos
domain-model
lift-json
lync-client-sdk
chord-diagram
specrun
ableton-live
adxstudio-portals
paypal-express
rhino-servicebus
separator
content-length
computer-algebra-systems
drawbitmap
ideamart
mmc
census
composite
p2
pretty-print
e10s
directoryservices
block-device
dd
camanjs
relocation
wordpress-theme-customize
php-5.4
phpthumb
doskey
transcoding
java.nio.file
google-cloud-save
qt-faststart
django-nonrel
jquery-mobile-dialog
jelly
selected
frameset
venn-diagram
pysimplesoap
newtonscript
hosts-file
onsubmit
spring-portlet-mvc
code-cleanup
custom-backend
adk
fireworks
inotifycollectionchanged
sql-server-profiler
mongomapper
html-input
createwindow
paster
gamequery
sproutcore-2
icanhaz.js
ncqrs
text-coloring
spec#
caching-application-block

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