Combo Box Question (1 Viewer)

DanG

Registered User.
Local time
Today, 05:43
Joined
Nov 4, 2004
Messages
477
I have a combobox that has a list of values that come from a table called campaigns.

What I want is to have the user choose one of the values from the list (combobox) and store that value in the data entry table (which the form is bound to). Currently as it is setup, it does exactly what I want it to do with one problem...

All my values from the combobox (campaigns) start with the year of the campaign (2009 Campaign1, 2010 Campaign2...). Now that it is 2010, I only want 2010 campaigns to show in the combobox (wich I did using the "format(date(), "yyyy")". The problem now is that all the previouse entries on the main form that had 2009 campaigns have no campaign value showing.

I think I understand what's going on but not sure how to solve it. It should take the value from the combobox and save it to the main forms bound field and show the value that is stored in the main form and not the value that is stored in the combobox.

Thank you for any assistance in advance!

Happy New Year by the way!!!
 

Mr. B

"Doctor Access"
Local time
Today, 07:43
Joined
May 20, 2009
Messages
1,932
You can make entries in your "campaigns" table for the campaign entries for 2010 that you need. Then place a filter on the values returned from this table to your combo box (using a query) to show only records that start with the value in the table that start with the current year. You will need to first have column in your query that returns only the first 4 characters of the Campaigns field like: Year: Left(Campaign,4) then filter that column by using something lik: Year(Date) as the criteria for the column.

This will allow the combo box to only return values relative to the current year.

Keep in mind that if you restrict the combo box in this way, you will not be able to select any value for the previous year, even if you needed to.

Just my thoughts.
 

DanG

Registered User.
Local time
Today, 05:43
Joined
Nov 4, 2004
Messages
477
Thank you for your reply, I have been working on too many projects lately and haven't had time to address this one yet.

I will try your approach, but wanted to make sure I thanked you!
 

Users who are viewing this thread

Top Bottom