471,073 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

How I got it to Work!

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
1 1070
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.

Similar topics

2 posts views Thread by Holysmoke | last post: by
1 post views Thread by Jeff | last post: by
6 posts views Thread by scottyman | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.