I have a form (frmSewer) which bounded to tblSewer. The code at the On Load Event is designed to open frmSewer is appropriate date is updated into tblFilingdatesa t the end of each quarter.
In other words, when a quarter ends, the Administrator must file a quarterly report, once this report id filed, he MUST complete the process by updating tblFilingDates with the date the report was filed.
Everything seems to work in year 2006 until we entered into the year 2007. Suddenly the db locked out....and the only way to unlock the form and keep it open is only when there is a date entry in tblFilingDates. DateFiled.
My On Load Event code is bypassing the date entry field or not reading it at all.
The same code is also duplicated at the AfterUpdate Event of txtPermitNo whic is also malfunctioning as dexcribed above..
Below is the On Load Event code of frmSewer. - Private Sub Form_Load()
-
Dim iQQ As Integer
-
Dim iYY As Integer
-
-
'Get current quarter/year based on system date
-
iQQ = DatePart("q", Date)
-
iYY = DatePart("yyyy", Now())
-
'If current date is not last of last quarter
-
If DateIsLastQuarterDate(Now()) = False Then
-
'If quarter 1 then for previous quarter, we need to subtract the year also
-
If iQQ = 1 Then
-
iQQ = 4
-
iYY = iYY - 1
-
Else
-
iQQ = iQQ - 1
-
End If
-
End If
-
'Call the function GracePeriodValidation to see if we are in within the grace period
-
'If not then throw an error
-
If GracePeriodValidation(Now(), iQQ, iYY) = False Then
-
MsgBox "You cannot proceed as no filing date has been entered" & vbCrLf & _
-
"for quarter " & iQQ & " " & iYY & "." & vbCrLf & _
-
"Please contact your administrator.", vbOKOnly + vbExclamation, FRM_TITLE
-
DoCmd.Close
-
End If
-
End Sub
' ************
4 1672 MMcCarthy 14,534
Recognized Expert Moderator MVP
Bill I'm uploading the database here for the convenience of other experts.
Mary
Bill I'm uploading the database here for the convenience of other experts.
Mary
Thanks for assisting in this regard.
Bill
nico5038 3,080
Recognized Expert Specialist
Hmm, are we having here THE billcute from EE ?<LOL>
I found in the procedure GracePeriodVali dation this code giving you the problem: - 'Check current date is within the filing date period
-
'Return false if invalid, TRUE otherwise
-
dValDate = DateValue(dValDate)
-
Debug.Print dValDate, DateAdd("d", GRACE_PERIOD, dLastDate)
-
If dValDate >= dLastDate And dValDate <= DateAdd("d", GRACE_PERIOD, dLastDate) Then
-
GracePeriodValidation = True
-
Else
-
GracePeriodValidation = False
-
End If
as the graceperiod is set to 14 it won't work after the 14th of this month....
Nic;o)
MMcCarthy 14,534
Recognized Expert Moderator MVP
Bill,
Does Nico's reply solve your problem or do you want me to keep working on it.
Mary
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: William Wisnieski |
last post by:
Hello Everyone,
Access 2000
I have a main form with a continuous subform. On the main form I have a
text field called . It gets populated based on what the user
selects in a field on the sub form (code in the AfterUpdate
Event). Here's the issue. If the user deletes a subform record. The
field on the main form shows null even if there is a value in the
preceding subform record. What I'd like it to do is immediately refresh to
|
by: Ivan |
last post by:
I am used to VB6 and am not sure how to do this in
Vstudio .NET. I have a main form which calls other
forms. I want to disable that main form while other ones
are called. I tried hiding it and creating a new instance
of the main form when returning to it but than my
application is just creating more forms. How do I hide
the main form and return back to it when exiting another
form?
|
by: Dennis |
last post by:
I have the following code for showing a form:
dim frm as new myForm
frm.ShowDialog (The Form Load Event is fired then I hide the form using
Me.Hide when the X in the UR corner is clicked).
'Do something in code
frm.ShowDialog (The Form Load Event fires again)
|
by: MLH |
last post by:
I don't always get what I want when I invoke the following
Me!MySubFormControl.Refresh
from code running in the main form. Am I doing something
wrong here? Someone suggested that I open the subform
itself (as a separate form) in hidden view anytime I open
the main form and attempt my refreshes there. I think that
is somewhat redundant and can't be what MicroSoft intended.
|
by: virtualgreek |
last post by:
Dear all,
I have a scenario that is driving me nuts. (MS Access 2003)
I have a form/subform (Continuous form) where it gets its data from tables Order and Order_Details.
In the footer section of the subform I have a hidden textbox named txtOrder_Total_Amount which displays the total of the whole order. On the main form I have a bound contol from the Order table, namely Order.Order_Total_Amount_Euro
On the subform I have fields such...
| |
by: abolos |
last post by:
Hi all,
I have a question. If I have a form that has a vb code in the Open Event and another code in Load Event, which one starts before when running this form? Does the Load Event code runs before or the vise versa?
Thank you,
Abolos
|
by: Dennis |
last post by:
I've noticed some old posts regarding this issue; but nothing recently
and no resolutions in the old postings.
Its almost hard for me to believe that this wouldn't be fixed by now.
I am using Access 2007.
The Forms Load event does not fire when the form is displayed. It
does fire when the next button "On Click" event occurs. I have 5 or 6
buttons, and it doesn't matter which one I press. The actual action
|
by: mdzeier |
last post by:
I need to know how to maxinimze subforms to the size of the main form.
I have managed to do the code to maximize the main form, but it does not work on the subforms. The main form contains 6 subforms which I need to maximize within the main form (the screen size).
Manually setting the size of the subforms is frustrating as I have serval users of the front end, personnally on 3 different PCs (incl laptop). I regularly update the front end of...
|
by: Saboor Mohideen |
last post by:
Can someone tell me which event occurs on Total TextBox:
Main Form
Name Type Event Used Event Set
All three textboxes are bound to a table
CashAmount TextBox AfterUpdate CashAmount+ChequeAmount=Total
ChequeAmount TextBox AfterUpdate CashAmount+ChequeAmount =Total
Total TextBox ?
SubForm
I need to auto-change the subform amount corresponding to Changes in Total TextBox on the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |