Records Count and Records Navigation Control

H

HELPMEMEME

Access 2007

I need to place on a "Personel Table Datasheet" an automated Value for the
"ID" field.

The Automated Value depends from the Type of Personel Being Inputed in the
previous field, example:

If in "Personel Type:" the word "Nurse" is picked from the Custom drop down
list. (Already done)

Then the "ID" field will be filled automaticly with a number between the
Range of 100 to 199.

If there are already 2 records with the value "Nurse" on the previous field
then the ID Number assigned for a new record with the Value "Nurse" on the
previous field should be 103

How do you write this in VBA...? I got as far as this

Private Sub Personel_Type_LostFocus ()

If Personel_Type.Value = "Nurse"
Then ID.value = 100 'for now 100 but here is where I need your help.
End If
If Personel_Type.Value = "Doctor"
Then ID.value = 200
End If

Close Private Sub (Or whatever goes here... I know just a lil of programing
Im good making sense but I lack the lingo and the language...)

You may have noticed that what Im trying to do is separate my nurses from
the doctors with ID Ranges but still keeping one Database.

By the way... I removed the "Autonumber" default that comes with the ID
Column... and switched it to a General Number... Can you please Help me...

Please remember I understand in words not in language nor Lingo Im working
on it though...


I also need to know how to add Records navigation button on my form... 2003
was easier...

Thanks
 

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