D
Dennis
Hi,
I’m on Access 2003 on XP Pro with all the latest updates.
I’m working for a charity that has a membership database. Each member is
assigned a door prize number. The goal is to not have any gaps in the door
prize number. When a member leaves the area, we flag that member as “goneâ€
and I want to re-assign their door prize number to the next new member. I’ve
already beat my head against the wall talking to management about why they
reuse number and they are not going to budge.
I can logically see what I need to do, but I don’t know how to code it. I
would appreciate any help on how to code this or a better way to approach is
issue.
I have a table called tblMember, which is keyed by an auto number field
called AcctNo. I also have the DoorPrizeNo field and Status field. The
status field has one of two values. The values are A for Active or D for
Deleted.
I have a membership form called frmMember. When the user enters a new
member using that form and the press the New Door Price No button, I want to
(in pseudo code):
Select the lowest available door price number from a member with a status of
“Dâ€
If that select works, then
Get the lowest available door prize number from the row with status of “Dâ€
Null out the door price number on the row with status = “D†& upd row
NewNo = LowestAvailableNo
Else
‘ Other wise assign the next highest number
NewNo = DMax(tblMember, DoorPrizeNo) + 1
End if
DoorPrizeNo = NewNo.
By the way, current row is in the tblMaster table and the row with the
deleted member is also in the tblMaster table. I don’t know how to read in
that record, extract the value I want, set that field to null, and write it
back out.
I would greatly appreciated any help.
Thanks,
I’m on Access 2003 on XP Pro with all the latest updates.
I’m working for a charity that has a membership database. Each member is
assigned a door prize number. The goal is to not have any gaps in the door
prize number. When a member leaves the area, we flag that member as “goneâ€
and I want to re-assign their door prize number to the next new member. I’ve
already beat my head against the wall talking to management about why they
reuse number and they are not going to budge.
I can logically see what I need to do, but I don’t know how to code it. I
would appreciate any help on how to code this or a better way to approach is
issue.
I have a table called tblMember, which is keyed by an auto number field
called AcctNo. I also have the DoorPrizeNo field and Status field. The
status field has one of two values. The values are A for Active or D for
Deleted.
I have a membership form called frmMember. When the user enters a new
member using that form and the press the New Door Price No button, I want to
(in pseudo code):
Select the lowest available door price number from a member with a status of
“Dâ€
If that select works, then
Get the lowest available door prize number from the row with status of “Dâ€
Null out the door price number on the row with status = “D†& upd row
NewNo = LowestAvailableNo
Else
‘ Other wise assign the next highest number
NewNo = DMax(tblMember, DoorPrizeNo) + 1
End if
DoorPrizeNo = NewNo.
By the way, current row is in the tblMaster table and the row with the
deleted member is also in the tblMaster table. I don’t know how to read in
that record, extract the value I want, set that field to null, and write it
back out.
I would greatly appreciated any help.
Thanks,