Forms and Autofill

S

Shivakat

God, but I feel dumb.

Folks, I support MS Office for a living, but my specialties are all
related to hacking the registry and making the things work... not
building databases with it.

So, I have to eat a slice of humble pie, tonight.

I have made a -very- simple database. There's only 3 fields: BookID,
Title, and IssueNumber. I'm catologuing my comicbook collection to
sell. I set this all up, it works fine. BookID is the key.

I then made a simple form for data entry. It automatically generates
the BookID and I fill in the Title and Issue number manually.

I have about 3000 comicbooks to go. After about 20 entries, I realized
this was going to be a long trip.

After playing around with combo boxes for hours, I'm now pulling my
hair out.

In the Title entry point of my Form, I just want to be able to start
typing the comic's name, and if I've already typed it before, have the
silly thing auto-fill the box. If I haven't typed it before, then I
just want the Form to let me add a new value to the feild.

In other words, I want to click on the Title feild on my Form, start
typing "UNCA" and have it automatically fill in "UNCANNY X-MEN". Then,
let me add onto it, so I can change the feild then to UNCANNY X-MEN:
AGE of APOCALYPSE and the silly thing not have a heart attack because
that value isn't in the table already.

Can anyone help a girl out?

-Jess
 
H

Howard Brody

Setting the AutoExpand property of the ComboBox to 'Yes'
will make it autofill and setting the LimitToList property
to 'No' will let you enter a value not already in the
list. What you need to do now is automate a Refresh for
the ComboBox so any new titles you add will be included
for the subsequent records.

I would recommend:

Set the RowSource property of the ComboBox to: "SELECT
DISTINCT [tblTableName].[Title] FROM [tblTableName] ORDER
BY [tblTableName].[Title]" Change [tblTableName] to the
name of the table in your database.

Requery the ComboBox in the AfterUpdate event of the
ComboBox: Open the Properties window, click the ALL tab
and right-click on the AfterUpdate event line. Select
Build then CodBuilder. When the Visual Basic window
opens, enter:

Private Sub cboTitle_AfterUpdate()
cboTitle.Requery
End Sub

Hope this helps!

Howard Brody
 
S

Shivakat

Howard Brody said:
Setting the AutoExpand property of the ComboBox to 'Yes'
will make it autofill and setting the LimitToList property
to 'No' will let you enter a value not already in the
list. What you need to do now is automate a Refresh for
the ComboBox so any new titles you add will be included
for the subsequent records.

I would recommend:

Set the RowSource property of the ComboBox to: "SELECT
DISTINCT [tblTableName].[Title] FROM [tblTableName] ORDER
BY [tblTableName].[Title]" Change [tblTableName] to the
name of the table in your database.

Requery the ComboBox in the AfterUpdate event of the
ComboBox: Open the Properties window, click the ALL tab
and right-click on the AfterUpdate event line. Select
Build then CodBuilder. When the Visual Basic window
opens, enter:

Private Sub cboTitle_AfterUpdate()
cboTitle.Requery
End Sub

Hope this helps!

Thanks, Howard!

Seems to have, some.
AUTOEXPAND was already set to Yes.

When I went to change the Limit To List property, it informed me that
I couldn't change that to NO unless I changed the value of the
ColumnWidth, which was set to 0",1" so I changed the ColumnWidth to
..15",1"

I set the RowSource to:
SELECT DISTINCT [Books].[Title] FROM [Books] ORDER BY [Books].[Title]

I then entered:
Private Sub Combo6_AfterUpdate()
Combo6.Requery
End Sub


Now, when I test it... I can enter in new data just fine, and it
doens't complain at me. It now does auto-complete, as well. However,
the refresh doens't seem to be working quite right. When I add new a
new value, it won't autocomplete until I close and open the form
again. Once I close and open the form, it will autofill those values.

If there's no simple solution, I guess I could just open and close the
form now and then to update it.

-Jess
 
H

happydaze

I found a pretty simple database program at collectorz.com. I am currently using it to catalogue my own comicbooks.

John
 

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