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

ComboBox won't allow me to select an item
Access 2010 - Missing Security Profile
Access 2010 Populate Subform with Query
How do I remove case-sensitivity from my combo box's autocomplete (Access form)
How to structure my query for a MS Access Chart?
Complicated crystal report help - Semicolon in the database field value
VBA procedure to import csv file into access
does backend path length affect frontend speed?
MS Access Syntax error
Query not running with “*” criteria
Acess 2007 one-to-many relationship counting
MS Access Form Load
Access 2003: Determine whether one or all of 4 fields exist in table
navigating through table records in Access VBA
Save record with default form values
Sub Reports In Main Report - Access Reports

Categories

HOME
pandas
ionic-framework
openlayers
hive
comparison
relay
cplex
xmpp
razor
jxls
cloudkit
iggrid
metatrader4
ssl-client-authentication
node-pdfkit
postgres-xl
usergrid
fortumo
flux
lucene.net
karma-jasmine
custom-wordpress-pages
amazonsellercentral
orleans
tar
realex-payments-api
kudan
restful-authentication
nhapi
applozic
xacml
assistant
dbclient
react-chartjs
binary-data
bosh
siesta-swift
typed.js
restlet
adobe-premiere
space-complexity
swift3.0.2
occlusion
c11
theano.scan
webix-treetable
leading-zero
eclipse-scout
galen
janrain
glew
nxlog
acoustics
clean-architecture
dotnetzip
sqlclient
cudafy.net
flow-control
crosswalk-runtime
passport-google-oauth
storekit
markojs
simplewebrtc
pagedlist
dlna
revolution-r
spidermonkey
jqgrid-formatter
tarjans-algorithm
tableau-online
php-ci
splash
myo
system.reflection
oxwall
knuth
cdt
terminfo
mesa
navigationservice
funcunit
poller
viadeo
tidy
google-cloud-save
bulkloader
flash-builder4.5
http-unit
funscript
regsvr32
subscript
oncheckedchanged
sudzc
subviews
asp.net-mvc-areas
bespin
database-management
compiler-specific
kdbg
virtual-functions
uimenucontroller
anti-piracy





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