Creating a warning prior to deleting a record

B

BigAl

I'm creating a membership database for an organisation. A problem I've
encountered is the young lady that will be using the completed database is
occasionally using control/z to undo an input error too frequently and
deletes the record that she is inputting. As the membership number is an
auto-number field this loses that particular membership number which I need
to stop from happening.
Is there anyway I can generate a warning prior to that final deletion to
stop this from occurring?

TIA

BigAl
 
T

tina

Autonumber is not recommended for the use you describe, for exactly the
reason you describe. suggest you assign the membership numbers
programmatically, at the point of data entry. you can run code in the form's
BeforeUpdate event procedure, as

If Me.NewRecord Then
Me!MembershipNoFieldName = DMax("MembershipNoFieldName",
"MembersTableName") + 1
End If

the text between the "If" line and the "End" line goes all on one line,
regardless of line wrap in this post (so you'll have a total of three lines
inside the procedure). replace MembershipNoFieldName and MembersTableName
with the correct names of those objects, of course. suggest you read up on
the DMax() function, so you'll understand how it works.

hth
 
B

BigAl

tina said:
Autonumber is not recommended for the use you describe, for exactly the
reason you describe. suggest you assign the membership numbers
programmatically, at the point of data entry. you can run code in the
form's
BeforeUpdate event procedure, as

If Me.NewRecord Then
Me!MembershipNoFieldName = DMax("MembershipNoFieldName",
"MembersTableName") + 1
End If

the text between the "If" line and the "End" line goes all on one line,
regardless of line wrap in this post (so you'll have a total of three
lines
inside the procedure). replace MembershipNoFieldName and MembersTableName
with the correct names of those objects, of course. suggest you read up on
the DMax() function, so you'll understand how it works.

hth


Thanks for that Tina.

I'll give it a go next week.

BigAl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top