another question on

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 ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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

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

Open in new window

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
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
        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

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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

isnoend2001Author Commented:
Thank you
don't have time to test now have to run an error for a couple hours
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
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.
isnoend2001Author Commented:
I will post the queston now
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.