Combobox Brain Poot

TxSteve

Registered User.
Local time
Today, 12:47
Joined
Dec 28, 2006
Messages
35
I'm using Access 2003 and want to display a series of items in a drop down list. They are codes (A, B, C) For code,
A = 2 (these are for two days)
B = 3 (days) and
C = 4 (days)
The values (2,3,4) will not be visible to the user.

I then want a text box displaying today's date.

Lastly a third box that will look at the first number from the Combobox (let's say the user selected B) and add that to the date to produce a due date. (example 7/23/2007 + 3 = 7/26/2007)

How can one best accomplish this? Please help.
 
Put the following code in the control source of your second Text Box;

=Combo.column(0)+[Text1]

Remember that the columns in a ComboBox are numbered from Zero up, so zero is your first column one is your second and so on.
 
You are the man!

One more question for you please. Now that the calculation is working on the screen, is there a simple way to write that value into my database? Guess I am about to enter the world of VB...?
 
Just bind your text box to the underlying field.
 
I'm not exactly sure how to bind it. My Control Source field has; =TypeCombo.column(1)+[Date1] in it. What would I enter to have it bind to my field, "DueDate" in my table?

-Steve
 
You would need to substitute DueDate for your formula. If you need to set DueDate using your formula, you need to add some VBA code to the After Update event of TypeCombo
 
Okay all is well in my world!

Here is what I did. I created another box, titled it DateHide, set visability to "No" and copied the code from my DueDate field into it. Then I reset my DueDate box to Control source of DueDate to match my table. Lastly I went to my initial date field (the one that starts all of this..) and created an event (After Update) Me.DueDate = Me.DateHide and all is well.

Thank you all for your help.
 

Users who are viewing this thread

Back
Top Bottom