Hi All,
I have a wierd problem that I can't work out. I am putting together a program to handle attendances and payment details for a martial arts club.
I have a form (Martial) that has the following:
- A DB_Grid (DBG_Name) that populates with a list of names from an interbase DB.
- A checkbox (CB_Attended)
- A checkbox (CB_Payment)
- A procedure called "UpdateUser" that loads all student information onto the form. It also moves the focus to CB_Attended.
- A procedure called "Attended" which performs various things depending on weather the CB_Attend is ticked or unticked. include moving the focus to CB_Payment.
- A procedure called "MakePayment" that adds or subtracts payment details.
A user can click on a name in the grid (Calls "UploadUser") and then press the space bar twice to attend and pay the student.
Everything seems to work perfectly except for the fact that a tick does not show in the 2 check boxes. If I click off and then back onto the name the tick's show up ("UploadUser" checks whether the students has attended/payed and sets checked to true/false)
procedure TMartial.CB_AttendedKeyPress(Sender: TObject; var Key: Char);
begin
if key = ' ' then
begin
if CB_Attended.Checked then
CB_Attended.Checked := false
else
CB_Attended.Checked := true;
Attended;
end;
end;
procedure TMartial.CB_PaymentKeyPress(Sender: TObject; var Key: Char);
begin
if key = ' ' then
begin
if CB_Payment.Checked then
CB_Payment.Checked := false
else
CB_Payment.Checked := true;
MakePayment;
end;
end;
Any help would be appreciated. I've spent 2 days on this as it is.
Colin
I have a wierd problem that I can't work out. I am putting together a program to handle attendances and payment details for a martial arts club.
I have a form (Martial) that has the following:
- A DB_Grid (DBG_Name) that populates with a list of names from an interbase DB.
- A checkbox (CB_Attended)
- A checkbox (CB_Payment)
- A procedure called "UpdateUser" that loads all student information onto the form. It also moves the focus to CB_Attended.
- A procedure called "Attended" which performs various things depending on weather the CB_Attend is ticked or unticked. include moving the focus to CB_Payment.
- A procedure called "MakePayment" that adds or subtracts payment details.
A user can click on a name in the grid (Calls "UploadUser") and then press the space bar twice to attend and pay the student.
Everything seems to work perfectly except for the fact that a tick does not show in the 2 check boxes. If I click off and then back onto the name the tick's show up ("UploadUser" checks whether the students has attended/payed and sets checked to true/false)
procedure TMartial.CB_AttendedKeyPress(Sender: TObject; var Key: Char);
begin
if key = ' ' then
begin
if CB_Attended.Checked then
CB_Attended.Checked := false
else
CB_Attended.Checked := true;
Attended;
end;
end;
procedure TMartial.CB_PaymentKeyPress(Sender: TObject; var Key: Char);
begin
if key = ' ' then
begin
if CB_Payment.Checked then
CB_Payment.Checked := false
else
CB_Payment.Checked := true;
MakePayment;
end;
end;
Any help would be appreciated. I've spent 2 days on this as it is.
Colin