Surname Database

surname database
my database using access 2007,want to be able to search for visitor,if exists,use existing record,if not,enter

when visitor comes,i enter their ID,if he/she exists,i enter a new record for her visit using the details already in the database.

But if he/she does not exist in the database,want to be able to enter his/her details in the visitor s details form and then after that,enter the details of his or her visit in the visitDetails form.

In other words,i have 2 forms,visitDetails which stores details of a visitor s visit such as timeIn,timeOut and natureOfVisit,the other form is visitorDetails which stores information about the visitot such as name,ID,surname,placeOfResidence.

I also have a query which prompts the user to enter the visitor ‘s ID,if a match is found,i want to be taken to the visitDetails to enter a new visit record for a visitor whose personal details already exist.
And if a match is not found,i want to be taken to the visitorDetails to enter personal details of a visitor and the to the visitDetails form to enter a new visit record for him/her.

thank for any help!

Yes you can do that. I assume that you have two recordsets named visitDetails and visitorDetails. And you input visitor id into a textbox called txtId. Let see if this one work. I’m not sure how it is done with Access 2007. But I’m using Visual Basic to talk to MS Access. I think the concept maybe the same.

‘ Assume I have rsVisitor as the object that point at the visitorDetails recordset
‘Move to the first record
rsVisitor.Movefirst
‘ Then you find the ID in the
rsVisitor.Find “ID = ‘” & txtID.text & “‘”

‘ The function FIND above will go from row to row to compare the ID string that you input and what exists inside the database. If it is exist the current position of the recordset is at the row that hold the ID. If not it will be End Of File

if rsVisitor.EOF then
‘ Not exist
else
‘ Exist
end if

Hope this will help
Regards

SQL Database Design in 11 minutes, part 1


Rivera Coat of Arms/Crest and Family Name History, meaning & origin plus Genealogy/Family Tree Research aid to help find clues to ancestry, roots, namesakes and ancestors plus many other surnames at the Historical Research Center Store


Rivera Coat of Arms/Crest and Family Name History, meaning & origin plus Genealogy/Family Tree Research aid to help find clues to ancestry, roots, namesakes and ancestors plus many other surnames at the Historical Research Center Store


$12.95


Family Name History scroll that can be used to create an intriguing wall plaque to display with pride. This guaranteed authentic collection of facts has been compiled for all people of your name, it is kept available in our collection to supply as required and will ship from stock. Over 400,000 names are readily available….

Lopez Coat of Arms/Crest and Family Name History, meaning & origin plus Genealogy/Family Tree Research aid to help find clues to ancestry, roots, namesakes and ancestors plus many other surnames at the Historical Research Center Store


Lopez Coat of Arms/Crest and Family Name History, meaning & origin plus Genealogy/Family Tree Research aid to help find clues to ancestry, roots, namesakes and ancestors plus many other surnames at the Historical Research Center Store


$12.95


Family Name History scroll that can be used to create an intriguing wall plaque to display with pride. This guaranteed authentic collection of facts has been compiled for all people of your name, it is kept available in our collection to supply as required and will ship from stock. Over 400,000 names are readily available….

Baker Coat of Arms/Crest and Family Name History, meaning & origin plus Genealogy/Family Tree Research aid to help find clues to ancestry, roots, namesakes and ancestors plus many other surnames at the Historical Research Center Store


Baker Coat of Arms/Crest and Family Name History, meaning & origin plus Genealogy/Family Tree Research aid to help find clues to ancestry, roots, namesakes and ancestors plus many other surnames at the Historical Research Center Store


$12.95


Family Name History scroll that can be used to create an intriguing wall plaque to display with pride. This guaranteed authentic collection of facts has been compiled for all people of your name, it is kept available in our collection to supply as required and will ship from stock. Over 400,000 names are readily available….

Premium Male DNA Test Y-DNA


Premium Male DNA Test Y-DNA


$224.00


THIS TEST ANALYZES ONLY YOUR MALE LINES & THE SAMPLE MUST BE SUBMITTED BY A MALE. Our Premium Male Test analyzes your biological father’s direct male line – his father’s father’s father, and so on, all the way back — by testing the markers of your Y chromosome. This is the ideal test for surname origin and genealogy searches. Your Y chromosome is examined at 25 locations for distinctive markers …