trying to determine if a date has changed in a mshflexgrid

I have mshlexgrid that has a column of dates if the date is clicked it opens another form with a calendar
if a new date is selected it replaces the selected date
how can i wait to see if a new date has been selected. before continuing
Dim OldDate as string
Dim NewDate as string
OldDate= gridMaster.TextMatrix(mintgridMasterCurRow,mintgridMasterCurCol)
open the calendar
now see it a date has been selected
Have code processing wait to see if a new date has been selected
NewDate= gridMaster.TextMatrix(mintgridMasterCurRow,mintgridMasterCurCol)
If NewDate <> OldDate then
mbGridisDirty = true
Save the grid
else
mbGridisDirty = false
End If
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:
When you say "Have code processing wait to see if a new date has been selected", which specific code processing do you mean?
0
isnoend2001Author Commented:
thanks Martin Liss
You have the code that opens the calendar. i am trying to determine if they did in fact select a new date
0
Martin LissOlder than dirtCommented:
Yes, I understand that but what I'm asking is if the answer is "no", what don't you want to do.
0
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:
if the answer is no then no changes need to be made, but if the date is changed then the filename in the grid needs to change the file on disk needs to be renamed eg;
C:\Program Files (x86)\Microsoft Visual Studio\VB10\Tasks\Personal\Tasks\10-25-2016.rtf
and the grid saved.
i think i found a solution
frmCalendar.Hide
frmCalendar.Show vbModal
0
Martin LissOlder than dirtCommented:
If that works, great.
0
isnoend2001Author Commented:
saving methods
if the change is a date ortime
the file name for 10-25-2016 is
C:\Program Files (x86)\Microsoft Visual Studio\VB10\Tasks\Personal\Tasks\10-25-2016.rtf
date is changed  to 10-01-2015 then the filename would be
C:\Program Files (x86)\Microsoft Visual Studio\VB10\Tasks\Personal\Tasks\10-01-2016.rtf
the the grid saved and the file on disk changed for the one record that has changed
or
i could just save the whole grid and filenames if the grid has been accessed.
on fomr unload
or for query unload and not worry about any changes
0
Martin LissOlder than dirtCommented:
Sorry but is there a question there?
0
isnoend2001Author Commented:
No question Which way would you go
update on record  or
i could just save the whole grid and filenames if the grid has been accessed.
on fomr unload
or for query unload and not worry about any changes
0
Martin LissOlder than dirtCommented:
I would do it in Label1_Click by adding lines 8 to 12. Lines 8 and 9 should be moe to the top of the sub, and I'll leave it to you to figure out the new date which you should substitute for the "<the new date>" part of line 12.
    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
        'new
        Dim intPos As Integer
        Dim strFilePath As String
        intPos = InStrRev(frmReminder.gridMaster.TextMatrix(gintRowClicked, 0), "\")
        strFilePath = Left$(frmReminder.gridMaster.TextMatrix(gintRowClicked, 0), intPos)
        name frmReminder.gridMaster.TextMatrix(gintRowClicked, 0) as strFilePath & <the new date>
    End If

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
isnoend2001Author Commented:
Thanks
0
isnoend2001Author Commented:
does  name frmReminder.gridMaster.TextMatrix(gintRowClicked, 0) as strFilePath & <the new date>
if no changes are made will  Name overwrite the file on disk ?
0
Martin LissOlder than dirtCommented:
Does it matter? If the name doesn't change the old one will be written over but the name will be the same so no real change.
0
Martin LissOlder than dirtCommented:
BTW try this little project. It demonstrates the use of what are called Private Properties which are properties (like Width and Height) associated with the form that you create. The advantage of them is that they can take the place of Public and Private variables which are error prone, but are available even after the form is unloaded. You could create a property to hold the date selected on frmCalendar.
PrivateProperty.zip
0
isnoend2001Author Commented:
Thanks I will take a look
0
isnoend2001Author Commented:
I only thought propertiy get/let was class modules
0
Martin LissOlder than dirtCommented:
As you can see you can create the m in both places.
0
isnoend2001Author Commented:
if I fix the month/year change problem and let's say 9/15/2015 is selected in the calendar. Because of that the Label1 for the day will be sunken. If I move forward a month want do you want label6 to say? Also if the date were, say, March 31, and I went back a month to February, what should label6 say and which if any of the label1's should be sunken?
I would like it to work just like the original frmCalendar, before all these changes Instead of trying to make open to a certain date i have included the original and called frmCalendar2 so i can use it when making a new reminder
frmCalendar2.zip
0
Martin LissOlder than dirtCommented:
If you want to go that route it means I've wasted a lot of time but oh, well.

If all you want to do is to choose a new date for an event it would be much easier and cleaner and involve a heck of a lot less code if you just changed the format of the date picker that's already on frmReminder to date or time depending on your need.
0
isnoend2001Author Commented:
I plan on using your calendar when editing the grid and the other for creating a new reminder
if we could just get the small bugs worked out
0
Martin LissOlder than dirtCommented:
What ability do you need that that's not available in a date picker?

Or if you want, ignore that and just post new questions one at at time and I'll try to answer them. If and when you do I'll need a new, complete, project zip file.
0
isnoend2001Author Commented:
Ok i don't like the looks of datepicker, but i will use both frmCalendar for new and date picker for editing
the grid.
I will create a new for called frmDtePicker
when clicking a cell in cols 1 and 3 the datepicker will open to that date and the date selected will be returned and replace the grid cells contents in this format "mm-dd-yyyy"
i will post the the project when i get it done.
0
Martin LissOlder than dirtCommented:
Unless I misunderstand what you're saying you don't need a form for the date picker and you don't even need a new date picker control. Just reuse the one that's already on frmDReminder!
0
isnoend2001Author Commented:
already posted new question
don't want to reuse. In modifying frmCalendar I noticed it could no longer be used for new after using to edit the griMaster
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.