Donor Form

G

Gary

I created a form to add donors to my database as well as post pledged
donations to existing donor accounts. the form will always add a donor but
will not bring up existing donors when I type the first few letters of the
last name. How can I get my form to automatically display existing donors
when I type the first few letters of the last name in the LastName field?
 
J

John Vinson

I created a form to add donors to my database as well as post pledged
donations to existing donor accounts. the form will always add a donor but
will not bring up existing donors when I type the first few letters of the
last name. How can I get my form to automatically display existing donors
when I type the first few letters of the last name in the LastName field?

By using a Combo Box (with the default Auto Complete property left
True) to display and select the donor, rather than a textbox.

Note that names are not unique; be sure that you include enough
information (last name, first name, suffix Jr./Sr., perhaps phone or
address) so that you can distinguish Bill Smith, that stingy tightwad,
from Bill Smith, the pillar of generosity.


John W. Vinson[MVP]
 
G

Gary

Hi John, Can I change the existing text box to a combo box without hurting
the form? or should I create another form to replace this one?
 
J

John Vinson

Hi John, Can I change the existing text box to a combo box without hurting
the form? or should I create another form to replace this one?

You can. Open the Form in design view; right mouseclick the textbox
and choose "Change to...".

You may need to tweak the relevant properties of the combo box:

Row Source - a Query returning the field that you want to store
(typically a numeric ID) and whatever other fields the user should see

Bound Column - which field in the RowSource you want to store in the
table; i.e. if the ID is the first field in the query, the Bound
Column should be 1

Control Source - which field you want to store the ID into

Column Count - how many fields in the Query do you want to include in
the combo box

Column Widths - a series of numbers separated by semicolons,
specifying the displayed width of each column. The ID field would
normally be 0" wide (store it but don't show it); the "typeahead"
feature works on the first nonzero width column.

John W. Vinson[MVP]
 
G

Gary

Hi John, well I am still working on this form, I went on vacation and when I
got back it was still waiting. I changed the box to combo, I created a query
to lookup donor ID, LastName, FirstName, Address, City,State,ZipCode. I
selected RowSource Type as Table/Query and row source ContributorQuery. the
box remains blank and if I type over the name that is always up when I open
the form, it changes the record instead of looking up the next record. can I
make a form that will automatically lookup all records, make a box that will
cause a jump to the records starting with those letters and then double click
the name I am looking for to jump to the pledge form. otherwise, I can place
a button to add a donor with not problem. that one always works correctly.
 
J

John Vinson

Hi John, well I am still working on this form, I went on vacation and when I
got back it was still waiting. I changed the box to combo, I created a query
to lookup donor ID, LastName, FirstName, Address, City,State,ZipCode. I
selected RowSource Type as Table/Query and row source ContributorQuery. the
box remains blank and if I type over the name that is always up when I open
the form, it changes the record instead of looking up the next record. can I
make a form that will automatically lookup all records, make a box that will
cause a jump to the records starting with those letters and then double click
the name I am looking for to jump to the pledge form. otherwise, I can place
a button to add a donor with not problem. that one always works correctly.

The Control Source of this combo *MUST* be blank. It sounds like
you've set the Control Source to DonorID - the way a combo box works
is that it pulls data from its Row Source query and stores the bound
column into the Control Source field; in this case, you don't WANT to
store it anywhere, you want to use it to find a record somewhere.

Delete the combo box.

Use the Combo Box wizard in form design view; select the option "Use
this combo to find a record". Use ContributorQuery as the row source.
Access will write some VBA code to use the DonorID retrieved by the
combo to *find* a record, rather than storing the ID. If you don't
find the wizard post back.

John W. Vinson[MVP]
 
G

Gary

Hi John, I think my last post did not make it so here I am again. sorry to
repeat myself. I created my form changed the text box to a combo box. I
found I had to change the column count for it to list anything. so now it
lists but if I click on the name I want, it changes the current record rather
than jumping to that record and populating the rest of the form with the
information from the record I am looking up. please help
gary
 
J

John Vinson

Hi John, I think my last post did not make it so here I am again. sorry to
repeat myself. I created my form changed the text box to a combo box. I
found I had to change the column count for it to list anything. so now it
lists but if I click on the name I want, it changes the current record rather
than jumping to that record and populating the rest of the form with the
information from the record I am looking up. please help
gary

Did you get my reply to your previous post, sent at 5:41?

John W. Vinson[MVP]
 
G

Gary

Hi John, thanks, that is exactly what I did! I will be working on it this
afternoon and let you know how it goes.

best regards,
gary
 
G

Gary

Hi John, Well, I made a copy of the database so I would have something to
fall back on. good thing I did! I made two extra now just in case. I have
successfully populated the database with current donors. I created the combo
box and I used "I want the combo box to look up the values in a table or
query" my other options are I will type in the values that I want and Find a
record on my form based on the value I selected in my combo box. you
suggested "Use this combo to find a record" so what I would really like to
do, is be able to double click or single click on the record I find in the
combo and that action would populate the form. I have been searching for
examples of this type of action but find none. I assume I need to know how to
add to the vb code that access writes for me to cause this to happen. I was
hoping that was a possibility. I Keep plugging away. I will learn this
without killing myself! (figure of speach)
Novice to Access
 
G

Gary

HI John, well don't I feel a little simple this evening. I am scratching my
head as to why this combo box does not work and I go back to the code and as
I am looking at the code, I see that it referances combo36 instead of
DonorLookup. I changed the referance and viola! search a record and the form
populates. If the record is not found, click on the add record button and
there you have a blank form ready to add a donor. I can not believe it took
me so long to figure this out. I guess I assumed when I changed the name
"Combo36" to DonorLookup that the code would be written with the name I
selected. well, I can not thank you enough for your help. I appreciate you
not telling me to go ask someone else! again, much appreciated I want to be
a good access user and get to be an expert user.
best regards,

Gary
 
G

Gary

Well, I have the combo box working, I look up a record and find that I do not
have the records alphabetized. So, with the way it is looking up my records,
I get the first record with a last name and that is that. If I want to find
the next record with same last name I have to use the scroll bar. not a
happy thought when I look at the fact that i have 4700 records to look
through. I need to get the records alpha so all the H names appear together
etc. must be a way to tell the combo box to look up last name rather than
ContributorID. which is what it does at the moment. I keep plugging away.
thanks again for your help.

Gary
 

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