Hi folks.
I have a query, qryHistory, which has the following field:
DaysOverdue: IIf([Due]<Date(),DateDif f("d",[Due],Nz([Return],Date())),0)
I also have a form (continuos), frmHistory, which is based on
qryHistory.
frmHistory has a checkbox, chkReturn, which has the following code
below. chkReturn assigns the current date to Return and calculates
Fine based on DaysOverdue and a few other criteria's. When chkReturn
is clicked again, the changes will be undone.
------------------------------------------------------------------------------
Private Sub chkReturn_Click ()
Static X
X = X + 1
If X > 2 Then X = 1
Select Case X:
Case 1: Me.Return = Date
If Me.DaysOverdue > 0 Then
If (Me.MemType = "Staff") Or (Me.MemType = "Lecturers" )
Then
Me.Fine = Me.DaysOverdue
End If
If (Me.MemType = "Student(PT )") Or (Me.MemType =
"Student(FT)")T hen
If Me.DaysOverdue > 7 Then
Me.Fine = (7 * 0.5) + (Me.DaysOverdue - 7)
Else
Me.Fine = Me.DaysOverdue * 0.5
End If
End If
End If
Case 2: Me.Return = Null
Me.Fine = Null
End Select
End Sub
------------------------------------------------------------------------------
I originally wanted DaysOverdue and Fine to be calculated when the
form is opened; however, assigning the calculations to the form's
OnOpen event failed (partly because of the fact that it is continuos,
I suspect). Someone in the forum suggested that I assign the coding of
DayOverdue to the query, which I did, and it worked (thank you!!!).
Which then leaves Fine, which I assigned to a checkbox, which works.
But I also want the form to calculate Fine when the form is opened.
Any ideas?
FrmHistory also has another checkbox, chkRenew. This is it's coding:
------------------------------------------------------------------------------
Private Sub Renew_Click()
Static X
X = X + 1
If X > 2 Then X = 1
Select Case X:
Case 1: Me.Borrow = Date
Me.Due = Date + 7
Me.Return = Null
Case 2: Me.Undo
End Select
End Sub
------------------------------------------------------------------------------
If I click on chkRenew, the values of Borrow and Due will be changed
as per the coding above, and if I click on chkRenew again, the changes
will be undone. However, if I click on chkRenew the 1st time, then
sort the form (or edit it in any way), then click on that specific
chkRenew the 2nd time, the values of Borrow and Due will not be
changed back to its original value. How do I correct this? 0 1189 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Pete |
last post by:
There is a Summary/Example further down...
On page one of my site I have a form with some checkboxes and detailed
descriptions. When the form is submitted (to page two), the values of
the checkboxes are picked up using $_POST and put into session
variables. On page two there is another form which is simply a
condensed version of the previous one (titles with no descriptions).
The checkboxes are named the same on both forms.
When...
|
by: Pete |
last post by:
Okay, I'm still stuck with this problem. Here's a quick recap/summary :-
1. Page 1:User checks 3 out of 10 checkboxes and submits form to page 2
2. Page 2:Item count shows 3 items. User checks an additional 2
checkboxes and presses Update button. Item count now shows 5 checkboxes
are checked and "New" checkboxes remain checked.
3. Page 2:User is happy and submits form to page 3
4. Page 3:Form items are converted into printable...
|
by: Ralph Freshour |
last post by:
I have multiple checkbox's created with an array name because I have
many on the same web page - their names are like:
frm_chk_delete
frm_chk_delete
frm_chk_delete
frm_chk_delete
etc.
Here is my code line that creates each checkbox (the php variable get
|
by: john |
last post by:
I am using ASP.NET and I have a datagrid. One of the columns in my
grid is all checkboxes. When the user clicks on a certain button on
the page, which is not in the grid, I want to be able to traverse
through all the checkboxes in that column and see how many are
checked. This is so that I can give them a confirmation dialog before
I do an action on the selected rows. How can I use javascript to
traverse through the checkboxes and count...
|
by: Ian |
last post by:
I have a continuos form with a Yes-No field and a text box on it, I am
trying to get the Yes-No box text to turn Red when it set to Yes and Black
when its set to No.
I have tried stuff like:
If = "yes" Then
.ForeColor = 0
| |
by: Jose.M.Huerta |
last post by:
I'm trying to display in a continuos form some *.jpg. I have a table
with the file path, (a photo of a person). Display these photos in a
single form is very easy, just using changing some properties at the
"current" event. But if I do it in the same way in a continous form
seems to be impossible, since all images of the form change at the same
time. I need a different image for each register. ¿How can I do it?
|
by: masterej |
last post by:
Developers,
Is there any way to disable all checkboxes on a form? I have a form
with 160 checkboxes and I want to be able to disable all of them. Is
there a way I can do something like this:
for (int i = 0; i < 160; i++)
{
string checkbox = "checkBox" + i.toString();
(Cast)checkbox.enabled = false;
|
by: Rick |
last post by:
Hi Guys!
I'm using report viewer instead crystal reports (VS2005), i have a report
that sends me 5 pages, i want to display all content in one view (continuos
pages), when i was using crystal it's crystal viewer has an option to show
continuos pages, but i can't find a similar property in ms report viewer,
how can i show continuos pages using ms report viewer?
Regards
|
by: viki1967 |
last post by:
I need one function javascript that:
1) when I enter in this htm page I see enabled only checkbox of categories A, M and T; checkboxes of microcategories all disabled;
2-a) If I select the checkbox of macrocategory A, M and T checkboxes all disabled;
2-b) If I select the checkbox of macrocategory M, A and T checkboxes all disabled;
2-c) If I select the checkbox of macrocategory T, A and M checkboxes all disabled;
3) If I select 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: 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,...
|
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: 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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |