ms-access


Simple IF statements not working


I am using simple IF statements but they are simply getting ignored when the command button is clicked for some reason.
What am I missing?
If Text4 = "" Then
MsgBox "You must add a GS Reference", vbInformation
Exit Sub
Else
End If
If Text6 = "" Then
MsgBox "You must add a Service Account number", vbInformation
Exit Sub
Else
End If
If Text8 = "" Then
MsgBox "You must pick an advisor", vbInformation
Exit Sub
Else
End If
If Me.Text10 = "" Then
MsgBox "You must select a date received option", vbInformation
Exit Sub
Else
End If
If Me.Text12 = "" Then
MsgBox "You must select a date failed option", vbInformation
Exit Sub
Else
End If
To me these should just be checking if a textbox is blank, if blank display a message the stop running the code. But its not working at all.
Try to replace checking textboxes by commands like this:
If Nz(Text6,"") = "" Then
or
If Len(Nz(Text6,"") = 0 Then
The last one works a little bit faster

Related Links

Checking social security numbers and business identity codes in Access 97
MS Access VBA Substitution Cipher Encrypt/Decrypt
How to get SQL from column/query schema in Access
MS Access sub-sub forms
Access 2010 web compatibility error: ACCWeb107019
MS ACCESS: Populate a subform with data from another table
how to read one field from one record
How do you dynamically create controls on a MS Access form?
MS Access date sorting with date/time components combined in one text field
Using Access 2003 VBA, I want to be able to have a report come up on the screen, not print out. But it doesn't work
“invalid use of null” for vba function that returns variant
Refresh combo box in Access 2007 without coding
select top 700 * from objectaer work only in sqlserver 2005 but 2008
All of my reports in MS Access were suddenly deleted
Calculate Total Event Attendees
How can i set field value in grid form Ms Access via VBA

Categories

HOME
variables
jdo
vbscript
netbeans
dictionary
json.net
youtube-dl
spring-jdbc
cakephp-2.5
windows-azure-storage
netflix
dosgi
highlight.js
sms-gateway
immutable.js
opencover
core-text
realex-payments-api
bootstrap-tour
restful-authentication
bootstrap-duallistbox
virtualdub
elasticsearch-net
saas
gsoap
nouislider
media-queries
kendo-ui-grid
http-referer
mapdb
android-browser
xenforo
uft-api
webdriver-manager
apple-news
google-datalayer
paxos
worksheet
boost-multi-index
alphabet
idisposable
svmlight
sqlclient
pg-dump
jspdf-autotable
spring-cache
account-kit
gnome-shell-extensions
messenger
time-and-attendance
jquery-filter
setuptools
log4c
autorest
blackberry-10
rvest
qtableview
spidermonkey
deis
method-parameters
event-bubbling
gwidgets
clicktag
typekit
qpainter
google-style-guide
device-manager
mesa
contenttype
jquery-layout
comexception
xceed-datagrid
braille
transcoding
cdc
google-cloud-save
gwt-rpc
android-screen-support
limejs
venn-diagram
netdna-api
gnustep
genshi
xdomainrequest
disclosure
lang
cxxtest
sudzc
subviews
user-friendly
substrings
zend-tool
simpletest
aquaticprime
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