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

Drop all connection to MS Access Database using ADO.NET
Import MS Access to CSV on Mac programmatically
MS Access - Is there a limit to Public Functions/Routines in MS Access? RTE #7?
Need to Allow Null or “” values for Dates - Access Query Data type mismatch
How to migrate MS access database to Oracle?
How to make a delete query in design view
Reserved error (-1524)
MS Access Import Error Table
Access 2007 Locking Issue - Attachments being overwritten
How to use a XSD schema definition file to bulk insert records with fixed-width columns into a database?
VB in Access 2000 : ado query got different result each time?
Using “OutputTo” to create a report that has VBA code
Access 2007 : Error 2950 appears only in ACCDE
How to INSERT SQL statements INTO table
Why is this DMAX not working?
Contact details window in ms access?

Categories

HOME
java
twitter
hive
vbscript
atom-editor
hook
netsuite
sd-card
google-docs
sqlite-net-extensions
uber-api
applepay
communication
nano-server
spring-kafka
size
msp430
excel-vba-mac
hammerspoon
cas
lightswitch-2013
ioio
bytecode-manipulation
main
cookiecutter-django
gzipstream
firebase-admin
unixodbc
total-commander
acoustics
businessworks
jsch
rainbowtable
youcompleteme
strptime
csound
composite-key
nbconvert
mediaelement
gnome-shell-extensions
watchconnectivity
deadbolt-2
grails-tomcat-plugin
mongocsharpdriver
ipconfig
cloudbees
netmq
comobject
mutation-observers
django-unittest
muse
map-projections
key-management
npapi
kineticjs
system.reflection
ng-animate
nstableviewcell
gadt
asp.net-dynamic-data
device-manager
xojo
contenttype
valueconverter
hippomocks
stxxl
ms-project-server-2010
apc
coverflow
easy-install
batterylevel
django-nonrel
tinn-r
gil
cascalog
getmessage
fireworks
pydot
mod-auth
mysql-error-1005
sudzc
sproutcore-2
preference
vc90
temporal-database
premature-optimization
grid-system

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