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_Click()
On Error GoTo Err_cmdCalcCumBm_Click
DoCmd.SetWarnings False
CalcCum "qryCalcCumYTDBM"
DoCmd.OpenQuery "qryYTDReturnsBM", acNormal, acEdit
CalcCum "qryCalcCumQBM"
DoCmd.OpenQuery "qryQReturnsBM", acNormal, acEdit
CalcCum "qryCalcCum6mBM"
DoCmd.OpenQuery "qry6MReturnsBM", acNormal, acEdit
CalcCum "qryCalcCum12mBM"
DoCmd.OpenQuery "qry12MReturnsBM", acNormal, acEdit
CalcCum "qryCalcCumCumBM"
DoCmd.OpenQuery "qryCumReturnsBM", acNormal, acEdit
CalcCum "qryCalcCum24mBM"
DoCmd.OpenQuery "qry24MReturnsBM", acNormal, acEdit
MsgBox "All Calculations Completed"
DoCmd.SetWarnings True
Me.Visible = False
Exit_cmdCalcCumBM_Click:
Exit Sub
Err_cmdCalcCumBm_Click:
MsgBox Err.Description
Resume Exit_cmdCalcCumBM_Click
End Sub 2 1584
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","table","dateField = #"
format(me.DialogBox, "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.
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_Click() On Error GoTo Err_cmdCalcCumBm_Click
DoCmd.SetWarnings False
CalcCum "qryCalcCumYTDBM" DoCmd.OpenQuery "qryYTDReturnsBM", acNormal, acEdit CalcCum "qryCalcCumQBM" DoCmd.OpenQuery "qryQReturnsBM", acNormal, acEdit CalcCum "qryCalcCum6mBM" DoCmd.OpenQuery "qry6MReturnsBM", acNormal, acEdit CalcCum "qryCalcCum12mBM" DoCmd.OpenQuery "qry12MReturnsBM", acNormal, acEdit CalcCum "qryCalcCumCumBM" DoCmd.OpenQuery "qryCumReturnsBM", acNormal, acEdit CalcCum "qryCalcCum24mBM" DoCmd.OpenQuery "qry24MReturnsBM", acNormal, acEdit
MsgBox "All Calculations Completed"
DoCmd.SetWarnings True Me.Visible = False
Exit_cmdCalcCumBM_Click: Exit Sub
Err_cmdCalcCumBm_Click: MsgBox Err.Description Resume Exit_cmdCalcCumBM_Click End Sub
--
Bas Cost Budde, Holland http://www.heuveltop.nl/BasCB/msac_index.html This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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) {...
|
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...
|
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...
|
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
|
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...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |