473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

end if function

i have a form in access that reads the following. i want to add a
function that will not allow the form to be ran if the dates entered in
the dlgdates box have already been ran. essentially i want an "end if"
dates have previously been entered. is there anyone who can help me
with this issue? the code for the current form is:

Private Sub cmdCalcCumBM_Cl ick()
On Error GoTo Err_cmdCalcCumB m_Click

DoCmd.SetWarnin gs False

CalcCum "qryCalcCumYTDB M"
DoCmd.OpenQuery "qryYTDReturnsB M", acNormal, acEdit
CalcCum "qryCalcCum QBM"
DoCmd.OpenQuery "qryQReturnsBM" , acNormal, acEdit
CalcCum "qryCalcCum6mBM "
DoCmd.OpenQuery "qry6MReturnsBM ", acNormal, acEdit
CalcCum "qryCalcCum12mB M"
DoCmd.OpenQuery "qry12MReturnsB M", acNormal, acEdit
CalcCum "qryCalcCumCumB M"
DoCmd.OpenQuery "qryCumReturnsB M", acNormal, acEdit
CalcCum "qryCalcCum24mB M"
DoCmd.OpenQuery "qry24MReturnsB M", acNormal, acEdit

MsgBox "All Calculations Completed"

DoCmd.SetWarnin gs True
Me.Visible = False

Exit_cmdCalcCum BM_Click:
Exit Sub

Err_cmdCalcCumB m_Click:
MsgBox Err.Description
Resume Exit_cmdCalcCum BM_Click
End Sub

Nov 13 '05 #1
2 1591
Are the dates in the dialog boxes written to a table somewhere? If so
something like this will work if you put it before at the top of your
function

if not isnull(dlookup( "dateField","ta ble","dateFiel d = #"
format(me.Dialo gBox, "mm/dd/yyyy") & "#")) then
Exit Sub
end if

I know... dlookups are evil etc. but it's quick and dirty and works!

If the dates arent written to a table somewhere then there's no other
way to check if those queries have been run with those dates.

Nov 13 '05 #2
How will you tell whether a date was entered?

What you post, looks like the code for a command button. Essentially,
you would disable the button after use, if it should be run only once.
Conditions for a subsequent run must be formalized, then, otherwise the
button is pretty useless ;-)

Tell me in 'user language' when this button is to be used. This can be
figured out.

js*******@gmail .com wrote:
i have a form in access that reads the following. i want to add a
function that will not allow the form to be ran if the dates entered in
the dlgdates box have already been ran. essentially i want an "end if"
dates have previously been entered. is there anyone who can help me
with this issue? the code for the current form is:

Private Sub cmdCalcCumBM_Cl ick()
On Error GoTo Err_cmdCalcCumB m_Click

DoCmd.SetWarnin gs False

CalcCum "qryCalcCumYTDB M"
DoCmd.OpenQuery "qryYTDReturnsB M", acNormal, acEdit
CalcCum "qryCalcCum QBM"
DoCmd.OpenQuery "qryQReturnsBM" , acNormal, acEdit
CalcCum "qryCalcCum6mBM "
DoCmd.OpenQuery "qry6MReturnsBM ", acNormal, acEdit
CalcCum "qryCalcCum12mB M"
DoCmd.OpenQuery "qry12MReturnsB M", acNormal, acEdit
CalcCum "qryCalcCumCumB M"
DoCmd.OpenQuery "qryCumReturnsB M", acNormal, acEdit
CalcCum "qryCalcCum24mB M"
DoCmd.OpenQuery "qry24MReturnsB M", acNormal, acEdit

MsgBox "All Calculations Completed"

DoCmd.SetWarnin gs True
Me.Visible = False

Exit_cmdCalcCum BM_Click:
Exit Sub

Err_cmdCalcCumB m_Click:
MsgBox Err.Description
Resume Exit_cmdCalcCum BM_Click
End Sub


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
14928
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
5
2823
by: phil_gg04 | last post by:
Dear Javascript Experts, Opera seems to have different ideas about the visibility of Javascript functions than other browsers. For example, if I have this code: if (1==2) { function invisible() { alert("invisible() called"); } }
2
7671
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would like mine to run immediately after it. So in the code below, what JS would i need to add to my "myfile.inc" page so that I could guarantee this behavior? <!-- main page --> <html> <head> <script type="text/javascript">
2
12680
by: sushil | last post by:
+1 #include<stdio.h> +2 #include <stdlib.h> +3 typedef struct +4 { +5 unsigned int PID; +6 unsigned int CID; +7 } T_ID; +8 +9 typedef unsigned int (*T_HANDLER)(void); +10
8
5093
by: Olov Johansson | last post by:
I just found out that JavaScript 1.5 (I tested this with Firefox 1.0.7 and Konqueror 3.5) has support not only for standard function definitions, function expressions (lambdas) and Function constructors (these three I knew about), but also conditional function definitions, as described in http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Defining_Functions ]. An example: function fun() {
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.