Combo box updating

  • Thread starter Thread starter sgricus
  • Start date Start date
S

sgricus

Ok yet another question.

I have a theater database. On the Purchase form, I want the user to
choose a Show Title (linked to ShowID), which then will bring up a set
of Performances. The PerformanceIDs are linked in a ShowID in a linking
table.

So basically, when someone chooses "Romeo and Juliet", I want the
PerformanceIDs that are associated with that show ONLY to come up in
the combo box.

THEN, I want the performance date and time for each performanceID to
automatically appear in the fields. So if you choose a different
PerformanceID in that combo box, the date and time related to that
performance will appear in the date and time fields.

I am very new to Access, so I am not sure how to begin here. And help
in easy to understand language, would be great.

Thanks!
 
Well that helped with the first two combo boxes, but then how do I
open unchangeable text boxes based on the info from the second combo
box?

SO right now, I can choose a show, and it brings up the performance
IDs. But when I select a perfID, I want the date, time, and ticket cost
to pop up for that performance.

Since those aren't combo boxes, I don't know how to do that.
 
Sorry: missed that part of the question.

In the AfterUpdate of the combo box, you put code to copy the values from
the combo box to the text boxes, using the combo box's Column collection.

Let's assume that the date and time are in column 2, and the ticket cost is
in column 3, and that you want to date and time put in a text box named
txtDateTime, and the ticket cost put in a text box named txtCost. You'd use
code like:

Me.txtDateTime = Me.MyComboBox.Column(1)
Me.txtCost = Me.MyComboBox.Column(2)

Note that the Column collection starts numbering the columns at 0, not 1.

BTW, note that I'm assuming Date and Time are stored in the same field. From
your question, it sounds as though you've got them as separate fields. They
really should be in the same field: it makes queries much simpler. For those
times when you only want the Date portion of the timestamp, or only the Time
portion, you can use the DateValue and TimeValue functions.
 

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

Back
Top