D
Dennis
Hi,
I'm on Access 2003 and will be going to Access 2007 shortly.
Background:
-----------
I have a Charity Fund raising database. When a person joins, they are
assigned an automatically generated account number by Access. (The account
number is not the issue.) However, mgmt want to also assign a re-usable
"Fund Raising" number and that is my issue.
When a new member joins, they are assigned a "Fund Raising" number. That
number will stay will that member until they leave the group. Once that
member leaves the group, we terminate the member on the system, and their
"Fund Raising" number becomes available to be re-assigned to the next new
member.
The fund raising number is a sequential number starting at 1 and going up.
Database:
---------
I will create a table called tblFundNo, which is keyed by the fund raising
number. There will be a special row keyed by the number zero. The zero row
will contain that last used high number.
The table's structure will be:
tblFundNo
key : Name = FundNo, Value = A Fund No
fld 1: Name = Available, Value = Y (# is available) or N (# not available)
fld 2: Name = HighNo, Value = Last number assigned.
Note: Only record 0 will have a value in the HighNo field. It's Available
field will be set to "N".
The Code:
---------
The following code will be in the form's After Update event:
When a new member is entered, I will search the tblFundNo using FindFirst
where Available = "Y". If I find one, I will assign that Fund Raising number
to the member and change that number's Available flag to "N".
If the FindFirst fails, I will read in the Zero row, add 1 to the last used
number, and write backup out the zero row. I will then create a new
tblFundNo row using the new last used number, set it's Available flag to "N",
and write it. I will then assign that number to the member and let Access
update the member record.
Once a number is assigned, I will pop up a msg box informing the user of the
member's charity no.
My Questions:
-------------
1. Is this the right way to do this in Access?
2. Is there a better way to do this in Access?
3. Is the form's After Update event the place where I want to put this code?
4. What is the best way to update my tblcharityNo table - using SQL or
using Access's db.AddNew, db.Update, and db.Close?
Thanks for your assitance.
I'm on Access 2003 and will be going to Access 2007 shortly.
Background:
-----------
I have a Charity Fund raising database. When a person joins, they are
assigned an automatically generated account number by Access. (The account
number is not the issue.) However, mgmt want to also assign a re-usable
"Fund Raising" number and that is my issue.
When a new member joins, they are assigned a "Fund Raising" number. That
number will stay will that member until they leave the group. Once that
member leaves the group, we terminate the member on the system, and their
"Fund Raising" number becomes available to be re-assigned to the next new
member.
The fund raising number is a sequential number starting at 1 and going up.
Database:
---------
I will create a table called tblFundNo, which is keyed by the fund raising
number. There will be a special row keyed by the number zero. The zero row
will contain that last used high number.
The table's structure will be:
tblFundNo
key : Name = FundNo, Value = A Fund No
fld 1: Name = Available, Value = Y (# is available) or N (# not available)
fld 2: Name = HighNo, Value = Last number assigned.
Note: Only record 0 will have a value in the HighNo field. It's Available
field will be set to "N".
The Code:
---------
The following code will be in the form's After Update event:
When a new member is entered, I will search the tblFundNo using FindFirst
where Available = "Y". If I find one, I will assign that Fund Raising number
to the member and change that number's Available flag to "N".
If the FindFirst fails, I will read in the Zero row, add 1 to the last used
number, and write backup out the zero row. I will then create a new
tblFundNo row using the new last used number, set it's Available flag to "N",
and write it. I will then assign that number to the member and let Access
update the member record.
Once a number is assigned, I will pop up a msg box informing the user of the
member's charity no.
My Questions:
-------------
1. Is this the right way to do this in Access?
2. Is there a better way to do this in Access?
3. Is the form's After Update event the place where I want to put this code?
4. What is the best way to update my tblcharityNo table - using SQL or
using Access's db.AddNew, db.Update, and db.Close?
Thanks for your assitance.