473,387 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

2 checkboxes and a continuos form

Hi folks.

I have a query, qryHistory, which has the following field:

DaysOverdue: IIf([Due]<Date(),DateDiff("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)")Then
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?
Nov 13 '05 #1
0 1173

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

Similar topics

2
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...
4
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...
8
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...
3
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...
3
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: ...
13
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...
5
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: ...
0
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...
7
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...

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.