Using a combo box to update a text box

G

Guest

OK..I know the answer is in here somewhere but I just don't know enough to
modify the other threads to make them apply to my situation. So, Sorry in
advance. Here is my prob.

for my intro to DB class I must create a DB for a library. I have a
customer/books/checkoutdata tables. Im using a form and subform to display
customer (main) and books/checkoutdata(sub). Im using the sub to enter
checkout info. I would like to get my combo box for title to auto the
corresponding author. the sub uses date from a query with books and
checkoutdata data.

Cory B.
 
J

John Vinson

On Wed, 25 Oct 2006 17:44:02 -0700, Cory B <Cory
I would like to get my combo box for title to auto the
corresponding author.

What does it mean to "auto" an author? Run him out of town in a
Cadillac?

Please explain what you're asking.

John W. Vinson[MVP]
 
G

Guest

Autofill the correct author

John Vinson said:
On Wed, 25 Oct 2006 17:44:02 -0700, Cory B <Cory


What does it mean to "auto" an author? Run him out of town in a
Cadillac?

Please explain what you're asking.

John W. Vinson[MVP]
 
G

Guest

I found what I was looking for. Thanks
I have the combo box row source as a query with title and author. Title is
column (0) and Author is Column(1) in the drop-down.

Private Sub Title_AfterUpdate()
' Update Author txtbox based on value selected in Title combo box.
[Author] = [Title].Column(1)
End Sub
 
J

John Vinson

I found what I was looking for. Thanks
I have the combo box row source as a query with title and author. Title is
column (0) and Author is Column(1) in the drop-down.

Private Sub Title_AfterUpdate()
' Update Author txtbox based on value selected in Title combo box.
[Author] = [Title].Column(1)
End Sub

If you're trying to store the author name in the Checkout table -
DON'T. It's redundant and unnecessary.

If [Author] is an unbound textbox on the form (so you can just display
the author to verify that it's the right book), you can do it this
way, or you can simply set the Control Source of the Author textbox to

=[Title].Column(1)

John W. Vinson[MVP]
 

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