By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,154 Members | 2,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,154 IT Pros & Developers. It's quick & easy.

How I got it to Work!

P: n/a
Thanks Everybody! I truly appreciate all of your input/ help!!!

Here's the solution that I came up with that works. Please feel free
to use it/ modify it to your own uses. However, I'm not sure if I got
lucky, or if it truly works as I envisioned it. But it works for my
needs!

************************************************** **************************

Dim TestDate As Boolean
Dim TestMinutes As Boolean

Const NO_DATE = "You did not enter a Date"
Const NO_MINUTES = "You did not enter any Minutes"

TestDate = True
TestMinutes = True
If IsNull(Me.Date) Then
TestDate = False
MsgBox NO_DATE, vbExclamation
Me.Date.SetFocus
Else
TestDate = True
If IsNull(Me.TimeSpent) Then
TestMinutes = False
MsgBox NO_MINUTES, vbExclamation
Me.TimeSpent.SetFocus
Else
TestMinutes = True
End If
End If

If (TestDate = True And TestMinutes = True) Then
DoCmd.Close
End If
************************************************** **************************

I have programmed a little in HTML, SQL, C, C++, Java, and JavaScript.
I'm not sure if the "Else" part of an "If" statement in VBA can be
used like this. So, I tried it, and it worked!

Thanks again! When I get good enough, I'll definitely return the favor
of helping others!

See you all again soon in another post!

Miguelito Bain
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This is a work of genius, Miguelito. You're well on your way to MVP status!
"Miguelito Bain" <mi***********@hotmail.com> wrote in message
news:1b**************************@posting.google.c om...
Thanks Everybody! I truly appreciate all of your input/ help!!!

Here's the solution that I came up with that works. Please feel free
to use it/ modify it to your own uses. However, I'm not sure if I got
lucky, or if it truly works as I envisioned it. But it works for my
needs!

************************************************** **************************
Dim TestDate As Boolean
Dim TestMinutes As Boolean

Const NO_DATE = "You did not enter a Date"
Const NO_MINUTES = "You did not enter any Minutes"

TestDate = True
TestMinutes = True
If IsNull(Me.Date) Then
TestDate = False
MsgBox NO_DATE, vbExclamation
Me.Date.SetFocus
Else
TestDate = True
If IsNull(Me.TimeSpent) Then
TestMinutes = False
MsgBox NO_MINUTES, vbExclamation
Me.TimeSpent.SetFocus
Else
TestMinutes = True
End If
End If

If (TestDate = True And TestMinutes = True) Then
DoCmd.Close
End If
************************************************** **************************
I have programmed a little in HTML, SQL, C, C++, Java, and JavaScript.
I'm not sure if the "Else" part of an "If" statement in VBA can be
used like this. So, I tried it, and it worked!

Thanks again! When I get good enough, I'll definitely return the favor
of helping others!

See you all again soon in another post!

Miguelito Bain

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.