Auto display information when entering ID

CSCS

Registered User.
Local time
Today, 09:13
Joined
Jan 10, 2004
Messages
91
Hi All!

I'm working on a Personal Information Database.

I want my system to do the following whenever I

enter a person's ID:

If the ID is already entered before, I want all

the personal info fields to be populated with

the person's details.

If the ID is not entered, then I will enter all

the person's details.

Any help will be very much appreciated!

Regards,
CS.
 
Design your form to display/edit your personal information and use a ComboBox to navigate the query. Use the "NotInList" event to add the new ID and go to the new record.
 
I'm sorry but I'm very beginner at this. So can explain how to do it exactly?
 
Have you completed any tables yet? Do you have a basic display/edit form yet? Use the Wizards as much as possible. They will do most of the work for you.
 
I have a PersonInfo with the following field:

ID (Primary),
Name (Text),
DateOfBirth (Date),
Address (Text)

and I have created a form comtaining the above field.

now I want the Name, DateOfBirth, Address field to be automatically populated whenever I type in an ID that have been entered before. i.e. if I entered ID# 123 and entered it's Name, DateOfBirth and Address, and I came back to enter the same ID again, the Name, DateOfBrith and Address field will be automatically populated.

Regards,
CS.
 
Good. Use the Wizard to put a ComboBox on your form. Select the third option: "Find a record on my form...". Select your first 2 fields ID (Primary), Name (Text) from the next page of the Wizard. Shrink the first column so you can not see it on the next page. Then give it a name on the next page and you are done!
 
Hi Guys,

I've been able to retrive the information if it was previously entered before using combobox as you suggested (THANKS!)

However when I'm entering a new ID the combobox doesn't allow it. I have read that I can do that using the NotInList event and I found a code for it. but it's doesn't work.

Does anyone know a code that works?

following you can find the code that I have used:
http://support.microsoft.com/default.aspx?scid=kb;en-us;197526

this is the part that I have problem with:
' Look for the customer the user created in the Customers form.
Result = DLookup("[CompanyName]", "Customers", _
"[CompanyName]='" & NewData & "'")
If IsNull(Result) Then
' If the customer was not created, set the Response argument
' to suppress an error message and undo changes.
Response = acDataErrContinue
' Display a customized message.
MsgBox "Please try again!"
Else
' If the customer was created, set the Response argument to
' indicate that new data is being added.
Response = acDataErrAdded
End If


my problem :
when I enter a new ID it asks me if I want to add it to the combobox. however when I click on Yes it gives me the "Please try again!" message.

Any help will be very much appreciated!

Regards,
CS.
 
We would need to see all of the NotInList code to offer suggestions.
 

Users who are viewing this thread

Back
Top Bottom