ms-access


How to segregate a single value from a query in MS Access


My apologies but I am a bit lost in the world of Microsoft Access. So I currently have a query that returns a column of values. The output looks like this:
SMABranchCode
Code1
Code2
Code3
etc.
This query then gets moved to a form text box. To do this, I have used Control Source like so:
=IIf(IsNull(DLookUp("SMABranchCode","PWS_SM_QUERY"))," ","X")
This works "Ok"; however there are going to be probably 30+ more text boxes going horizontally next to this one all running the same query. Above them is a label with the Code. So basically when it spits out the data it looks like this (as long as there is an entry for that code):
Code 1 | Code 2 | Code 3
X | X | X
The problem is, I either need to go and create a query for each of these text boxes so that it only pulls a single entry for each Code OR I can hopefully change up my Control Source entry (=IIf(IsNull(DLookUp("SMABranchCode","PWS_SM_QUERY"))," ","X")) to include criteria so that each text box has its own Criteria, so that from the one original query, each Code (1,2,3) only displays its information.
I have tried changing DLookUp to have criteria which has looked like this:
=IIf(IsNull(DLookUp("SMABranchCode","PWS_SM_QUERY","SMABranchCode = Code1"))," ","X")
However that gives me an #Error! in the boxes I apply it too. I'm hoping maybe someone can help me figure out a solution since my brain is turning to mush over this.
Thank you
I presume SMABranchCode is a text type field. Criteria values for text fields must be delimited with apostrophes, date/time field values would use #.
"SMABranchCode = 'Code1'"

Related Links

How do you set the required property when adding a column in Access using ADOX?
Export From Access to Excel
access 2010 - parameters button is disabled
Several If Statements in an access 2007 vba subroutine. Curious if there is another way?
reliable way of overwriting access database on live website
How to specify page width and length for printed (or html) report?
How to bind the contents of a combo box to the value of another
Access VBA: DLookUp function giving type mismatch error
Microsoft Access - If Null then
How do i reference the value of a control in a rowsource query?
How to query number of attachments from Attachment field in Microsoft Access?
Problem adding a row into a typed dataset
Efficient use of calculations in MS Access
Access VBA: Set record source of form on button click
Layout hierarchical issue in an Access report
Creating search query in MSACCESS

Categories

HOME
gerrit
webpack
magnific-popup
fluentd
ngrx
push-notification
reserved
google-api-php-client
session
leon
fancybox
here-api
postgres-xl
google-cloud-ml
jplayer
alignment
workload-scheduler
excel-vba-mac
alpine
jprofiler
lldb
conemu
csrf-protection
excel-2007
captiveportal
lcd
crosstab
emgucv
url-scheme
uninstall
nhapi
greendao
c++-amp
quote
google-cloud-nl
file-rename
newline
srcset
bpel
exuberant-ctags
usbserial
android-kernel
serve
abstract-class
service-discovery
hilbert-curve
splice
broadcastreceiver
galen
sfdc
texmaker
estimote
gpx
thin
wso2carbon
smartcontracts
revapi
jquery-nestable
colorama
csound
crypt
font-size
akka-cluster
flutterwave
imanage
smart-table
time-and-attendance
url-pattern
passport-google-oauth
measures
nsfilemanager
storekit
gstreamer-0.10
bluegiga
rhino-servicebus
cloudbees
sdhc
eclipse-clp
security-testing
sysinternals
myo
mono-embedding
knuth
tld
phpthumb
comexception
hyprlinkr
didselectrowatindexpath
mysqltuner
commoncrypto
inbox
ril
android-screen-support
path-separator
isnullorempty
trusted
gil
cisco-jtapi
first-responder
frameset
armcc
objective-c-2.0
dbproviderfactories
code-cleanup
vdsp
xmlspy
oncheckedchanged
digest-authentication
swing-app-framework
noscript
thread-local-storage
genealogy

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