472,984 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 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 1108
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
3
by: Douglas Buchanan | last post by:
Buttons don't work if form is opened on startup A2k If 'frmMain' is set to open by default at startup none of the buttons work. If 'frmMain' is opened from the database window then all the...
15
by: Brett | last post by:
I'd like to know what management and the work environment are like where you work. I need something relative to compare my current work environment. Here's a few questions I have: 1.) Is it...
2
by: Holysmoke | last post by:
Hi, I have a asp.net form with a button in it. In the onlclick event of button I want to write a function which does some a bit of work with a timespan of 15 seconds. So I want to show a image...
1
by: Jeff | last post by:
Hello, I have developed a library of controls but for the life of me cannot get ToolboxBitmapAttribute to work -- my image simply will not display in the toolbox of any project using my...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
48
by: Jimmy | last post by:
thanks to everyone that helped, unfortunately the code samples people gave me don't work. here is what i have so far: <% Dim oConn, oRS, randNum Randomize() randNum = (CInt(1000 * Rnd) + 1) *...
33
by: bonk | last post by:
I have an application that needs to perform some background work, i.e. Logging, wich must not block the main thread. How would I basically design such a scenario? It is obvious that I should do...
11
Niheel
by: Niheel | last post by:
http://bytes.com/images/howtos/information_overloaded.jpgPaul Graham wrote an interesting article a few months back about how the internet is leading to information overload for information workers...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.