Hi, I have three combo boxes which i will use for entering a date. mm/dd/yyyy. I've already made an entered their values but how do i combine them to a single string to be stored?
Hi, I have three combo boxes which i will use for entering a date. mm/dd/yyyy. I've already made an entered their values but how do i combine them to a single string to be stored?
try:or "/" in between if the combos are being used for each part of the date.Code:combo1 & combo2 & combo3
thanks. for the quick reply. i shall try it out later.
EDIT: sorry but how do i use this?
that's vba code behind a form. when referring to controls, you don't have to use "me." as the qualifier.
concatenation in vba is produced by the ampersand symbol. "&"
so when you combine the values together, throw it wherever you want to, by whatever method, vba or not, that you want to.
So i should have something like this?
vDate = combo1 & ,"/", & combo2 & ,"/", & combo3
NO.
no commas sir, just the ampersands. e.g. -
field1 = "1"
field2 = "15"
field3 = "2010"
to get a date (each field is a combo box name):if you get a type mismatch error when you're doing it, you may have to use:Code:myvariable = field1 & "/" & field2 & "/" & field3Code:myvariable = cstr(field1) & "/" & cstr(field2) & "/" & cstr(field3)
i see. thank you for the correction.
you bet!![]()