Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

Set a date format

I have a dropdown box with the following format:

2012-November
2012-December
2013-January
etc....


When a user selects "2012-November" I need a variable named Report to be set to "November, 2012"

How can I do this in VB6?
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Simplest would be:

Report = Replace(Mycombo.text, "-", ", ")
ASKER CERTIFIED SOLUTION
Avatar of Brook Braswell
Brook Braswell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Report = Right("MyCombo.Text, len(MyCombo.Text) - instr(1,MyCombo.Text,"-")) & "," &  _
               Left(MyCombo.Text, instr(1,MyCombo.Text,"-") - 1)
Sorry, remove the quote, should be

Report = Right(MyCombo.Text, len(MyCombo.Text) - instr(1,MyCombo.Text,"-")) & "," &  _
               Left(MyCombo.Text, instr(1,MyCombo.Text,"-") - 1)