Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concat two Comboboxes into one field

Status
Not open for further replies.

bigz60

Technical User
Apr 18, 2007
40
US
Hello. I have a strange request from my boss, and I cannot seem to figure it out.

We have a db that we enter certain invoice information from vendors. We only receive one invoice per month.

My boss wants to have two comboboxes on a form, one for the month, and one for the year. I am able to create those with no problem.

My problem is this. He then wants the values to be combined and stored in one field in the tables.

Example:
Combobox 1: 01 (January)
Combobox 2: 2009

should be stored in the table as: 012009

I cannot seem to figure out how to bind the concatenated values back to the table.
 
how about

cstr(form!formname!combobox1)&cstr(form!formname!combobox2)
 
Why? If you store the date you can get the information easily enough and it is more use further down the road.

Format(MyField, "mmyyyy")

You can also use a calendar control or such like to pick the date. This way life is easy and you don't lose data.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top