another question on http://www.experts-exchange.com/questions/28843339/

I have changed the date format on column 1 from 09/25/2015 to 09-25-2016 like column 3
Ihave a form with an mshflexgrid that opens a Calendar form to the date on the cell selected
 the calendar then  returns the new seleted date to the cell selected
this works fine on the dates in the 3rd column, but i need it to also work on the first column
how can this be done ?
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
If after clicking in column 1 you want the new date to show up in column 3 then all you need to do is to change this in label1_Click

If (frmReminder.gridMaster.Col = 3 And frmReminder.gridMaster.Text <> "" Then

Open in new window

to
 
   If (frmReminder.gridMaster.Col = 3 Or frmReminder.gridMaster.Col = 1) And frmReminder.gridMaster.Text <> "" Then

Open in new window

0
isnoend2001Author Commented:
I don't want the new date to be put into column 3. I want it to be put into the same cell that is clicked in column 1
0
Martin LissOlder than dirtCommented:
OK then in addition to the change above,

Add a new constant (You have a lot of constants already so you may already have one that stores the column number that's clicked in the flexgrid but I can't be sure).
Public gintColClicked As Integer

Open in new window


In Label1_Click add line 7
    If (frmReminder.gridMaster.Col = 3 Or frmReminder.gridMaster.Col = 1) And frmReminder.gridMaster.Text <> "" Then
        calDate = CDate(frmReminder.gridMaster.Text)
        Label2.Caption = Format$(calDate, "mmmm")
        Label3.Caption = Format$(calDate, "yyyy")
        gintRowClicked = frmReminder.gridMaster.row
        'new
        gintColClicked = frmReminder.gridMaster.Col
    End If

Open in new window

In frmCalendar Unload change this
    .TextMatrix(gintRowClicked, 3) = DateSerial(Year(calDate), Month(calDate), gintLabel1Index - firstday)

Open in new window

to this
    .TextMatrix(gintRowClicked, gintColClicked) = DateSerial(Year(calDate), Month(calDate), gintLabel1Index - firstday)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

isnoend2001Author Commented:
Thank you
don't have time to test now have to run an error for a couple hours
0
isnoend2001Author Commented:
Ran into an issue if clicking column  3 in the grid and selecting a different year. the new year is not put into the cell on further testing selecting a different month does not work either
0
Martin LissOlder than dirtCommented:
You said you were planning on posting a new question about selecting the date in the calendar. I can solve the above along with a couple of other problems there.
0
isnoend2001Author Commented:
I will post the queston now
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.