Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a record that already exists

Status
Not open for further replies.
Jul 5, 2001
40
0
0
US
I have a text box witch referrences a basic table labeled ContributorName and a subform which lists total contributions by date and other items unrelated to the problem I'm having. When I input the name of a contributor that is a duplicate, I would like it to pull that record up for editing only if it exists. If it doesn't exist, I would like it to just continue creating a new record.

Is this doable or am I going to just have to create a query that will combine duplicates. That's all I've found to do so far and I don't much care for it.

Thanks in advance.
 
Sorry, forgot to mention that ContributorName is what links the subform and main form together.
 
In you table, make the contributor the primary key (no dulicates).

When you enter your form, tab into the text box and press ctl+F, a find dialog will come up. Type the contributor in the find dialog and it'll take you there. Tyrone Lumley
augerinn@gte.net
 
That will work just fine, but I don't want my users to have to do this. It would be a little more nice if it were automated for them so that if there is a new record it creates one, and if the record exists that they don't type the name in wrong because it already exists. I may have a bandaided solution which is create a list box based off of a query and as the user inputs a name the list will requery until they are through. Selecting the record to go into the form. Is a work around, but it would be nicer if it were on the original form. Less programming = happier programmer!
 
I have a similar situation. It has the equivilant of your contributor linked in relationships. I have the contributor as a pulldown in the form. When the user selects the contributor it automatically updates a subform within the main form, pulling up that contributors information (information on the subform is of course from the contributor information table). If there is no contributor in the list my user can enter the subform and add the information, then go back to the pull down and select the newly created name. In order to get this to work I had to create the relationship, build the subform, add the pulldown, then add the subform. When adding the subform there was a selection how to link the subform to the main form. If I fixed things as I was going it wouldn't work. I had to start from the beginning.
 
Alright, easier way to do it...

Made an input for that had a list box. After inputing the Last name, (or Company name of the contributor) I had an after update with VB, which ran the SHOWALLRECORDS macro. The form was tied in by a query which referenced the table and then tied into the Last name box. It then refreshes the list. If the name exists, they can click on it to bring up the form with their already entered information. If they didn't exist, it passed the information in which they were typing to the form that has contributions.

I though this would be a difficult task, but it acutally turned out to be somewhat simple. Anyway, thanks for helping.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top