Auto fill fields

G

Guest

Is it possible to have access auto fill a field in a form or table based on
info allready in previous records in the same way that excel does.

Im trying to create a simple DVD database that among other data has a table
with 4 fields for stars. (star1, star2 etc)

What I would like to happen is that when I enter a new record either in form
or table view that when I begin to type in the name of a star already in one
of the fields that it would complete the name based on previous entries in
any of the 4 fields so that I dont have to type the complete name in.

Thank you
 
A

Alex White MCDBA MCSE

Hi,

you would need to capture keyboard events if doing this in a form, if you
switch the 'key preview' property for the form to yes, then you can process
keystrokes and then run queries with each keystroke to find the best match.
Be warned this idea could slow down the form quite a lot, so do some
performance testing, if you want to do this for specific fields/textboxes
then look for the 'on key press' event for the textbox.

Hope it helps.

Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
L

LGC

I would suggest that you have a table for the stars:

StarID Name
0001 Star

Have another table linking the stars to the DVD.

DVDID StarID
0056 0001

In this way you are not limited to 4 starts for each DVD. You can use a
multi-select listbox to select the stars for each DVD and use code to add a
star if it is not in the list.

This would be the more normalized approach.

LGC
 

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