need adjusment to code written by another coder

mstrOpenDate i am sending the date to the calendar instead of getting the value from  from the grid
i have 2 diifferent columns that send the date and the receiive the value.

public mstrOpenDate as string ' open the calendar form to this date
send the cells value to the calendar form eg;
 mstrOpenDate = TextMatrix(mintgridMasterCurRow, mintgridMasterCurCol)
gstrTaskDueDate label6.caption 'get the date user clicked on
.TextMatrix(.row, .Col) = gstrTaskDueDate, get the new date clicked on the calendar
i have tried to adjust it to no avail.
how can this be done ?
i will upload the project when i determine what files are not allowed
isnoend2001Asked:
Who is Participating?

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

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

isnoend2001Author Commented:
Martin LissOlder than dirtCommented:
Let me take a look and I'll let you know if I have question. (Don't I always:)
isnoend2001Author Commented:
ok
just noticed an error need to send Flexgrid.dat
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

isnoend2001Author Commented:
tried 2 times to upload first it was .ico,then .wav
Martin LissOlder than dirtCommented:
I need FlexGrid.dat, Test.frm and Tasks.res.

If any of those are a problem for EE you can probably just rename them as txt files or load them on some file sharing site like SpeadyShare or MediaFire.
Martin LissOlder than dirtCommented:
Go to one of the sites I mentioned and upload a zip of the whole project making sure you include the missing files. Then post the resulting URL.
isnoend2001Author Commented:
disregard Test.frm and Tasks.res
i am uploading FlexGrid.dat
The extension of one or more files in the archive is not in the list of allowed extensions: GridFolder/FlexGrid.dat
i will rename FlexGrid.dat to FlexGrid.txt and try again
 if i still have problems i will upload the file to my site and give you the url
isnoend2001Author Commented:
Martin LissOlder than dirtCommented:
This could take a while. I'm familiarizing myself with the project now.
isnoend2001Author Commented:
ok let me know when your done laughing
Martin LissOlder than dirtCommented:
Everyone starts somewhere. But in a future question or on your own someone should go through the project pretty much line by line and
Delete most or all of the comment out code
Delete the procedures that aren't used at all
Properly indent the procedures
Give meaningful names to all the controls
Get rid of any buttons or controls on frmReminder that aren't being used (if there are any)

I understand that the above would be a large effort but trust me that your project will be much easier to maintain and understand once you do it.

I would start by making a backup copy of the project in case something was changed incorrectly.

If you think that the above is a good idea, please don't do it until this current problem is resolved.
Martin LissOlder than dirtCommented:
In the previous question we worked on which was "Open a calendar form to a certain date vb6", part of my solution was this line.

Label6.Caption = Form1.MSHFlexGrid1.TextMatrix(1, 1)

However in this question that line has been changed to this

Label6.Caption = mstrOpenDate    '   Form1.MSHFlexGrid1.TextMatrix(1, 1)

Why?
isnoend2001Author Commented:
Label6.Caption = mstrOpenDate was just an attempt i made to get the calendar to open to the value passed to mstrOpenDate. it did not work. If mstrOpenDate is empty the it opens to todays date
Cleaning up the code was somehting i was going to do once
I keep running into new things to consider. The last was the ability to create a one time reminder
for a time; eg; call the doctor today at 4:00 Pm. so i created a new filename prefix "Tm"
all the other am/pm times were daily.
the cmdUpDateGrid_Click buttons code will be placed into a timer as per your suggestion
the project was complete. I do backups to external hard drive every AM.
I try to get one thing working at a time then find out that that an improvement is needed.eg;
i went to change a date in the grid from 10-20-216 to a future different date  and found it would be
more efficient if the calendar opened to that date rather than todays date to prevent many mouse clicks
Martin LissOlder than dirtCommented:
I'm a bit confused. Please tell me what's happening now with a statement like "The calendar opens to today's date at startup", and what you want to have happen with a statement like "I'd like it to open to the date of the first task". (I know that that's probably not what you actually want.)  Please keep it simple because too much detail can sometimes get in the way.
isnoend2001Author Commented:
Sorry about the delay had to take my sis grocery shopping
in keeping it simple
click the 3rd column 3rd row that has the date 10-25-2016
i want the frnCalenar to open to that date(10-25-2016)
Martin LissOlder than dirtCommented:
OK try this. When you click in column 3 of the grid and the value in that cell isn't blank, the calendar opens to the date. A couple of things to note:
If you click a date in column 1, the calendar opens to 12/30/1899 via existing code and you need to exit the app to start over.
If you click in column 3 the calendar, as requested, opens to that date but after closing the calendar the date is deleted.

Some other things.
I added basChangeLog. The use of this log of changes is explained in this article of mine. If you don't see a need for the module you can delete it.

The attachment contains frmCalendar, frmReminder and basChangelog.bas
Q28843339A.zip
isnoend2001Author Commented:
trying to test no .vbp file
Martin LissOlder than dirtCommented:
Make a copy of your project folder. In the original folder
Replace the two forms with the ones in the zip file
Copy the new bas file to the subfolder where the other ones are
Doubleclick your existing vbp file
Project->Add Module->Existing and choose the new bas file.
isnoend2001Author Commented:
followed you instructions, but getting tons of errors. is there a reason for no vbp file ?
Martin LissOlder than dirtCommented:
I thought I could get away with just sending you the files I changes but I guess not. Download the complete project from here.

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:
Got it, don't see your changes
suggestion instead of marking "New" mark "MlNew" i have lots of code with the "New" Label
Martin LissOlder than dirtCommented:
Look for "Q2884339"
isnoend2001Author Commented:
Thanks hope you keep my code as i will have more questions
I need to decide between formating dates eg, "-" vs "\"
Martin LissOlder than dirtCommented:
Isn't it 2AM where you are?
isnoend2001Author Commented:
I am 30 miles from Reno,NV pst it is now 4:55 AM never am i awake a 2AM
isnoend2001Author Commented:
I downloaded the file from MediaFire, but it is stlll missing a vbp file, but no need now
isnoend2001Author Commented:
I have noticed this:
opening the caledar to a specific date then selecting a new date the Label6 date does not change to the new selected date
i have added this to the frmCalendar unload to get the return value

Private Sub Form_Unload(Cancel As Integer)
If mEditMode = True Then
       frmReminder.gridMaster.TextMatrix(mEditRow, mEditCol) = Label6.Caption ' put the date into the grid in frmReminder
   End If
End Sub
isnoend2001Author Commented:
is this unfixable ?
Martin LissOlder than dirtCommented:
I misunderstood. I thought that post ID: 41256372 meant that you had fixed the problem. I'm sure I can fix it and I'll get to it later today.
Martin LissOlder than dirtCommented:
Alright, I made a few changes.
In frmCalendar Unload I added
'******* Q28843339A Start *******
With frmReminder.gridMaster
    .TextMatrix(gintRowClicked, 3) = DateSerial(Year(calDate), Month(calDate), gintLabel1Index - firstday)
End With
'******* Q28843339A End *********

Open in new window


Here's a new frmCalendar Label1_Click. I added lines 10, 11, 12 and 31.
Private Sub Label1_Click(Index As Integer)
    Dim NewDate As String
    Dim txt As String
    Dim iIndex As Boolean
    Dim InputText As String
    Dim EntryDate As String
    If Label1(Index) > 0 Then
        mbLabel4Clicked = False
    End If
    '******* Q28843339A Start *******
     gintLabel1Index = Index
    '******* Q28843339A End *********
    
    If Not mFormLoad Then
        
        frmReminder.SetLblDaysText
'        If mbLabel4Clicked = False Then 'only if a date is selected
'          InputText = InputBox("Task Name", "Task")
'        End If
    End If
    
    Label1(old).BorderStyle = 0 'old off
    Label1(Index).BorderStyle = 1 'clicked on
    '******* Q28843339A Start *******
    'calDate = DateSerial(Year(calDate), Month(calDate), Index - firstday) 'get day clicked
    If frmReminder.gridMaster.Col = 3 And frmReminder.gridMaster.Text <> "" Then
        calDate = CDate(frmReminder.gridMaster.Text)
        Label2.Caption = Format$(calDate, "mmmm")
        Label3.Caption = Format$(calDate, "yyyy")
        'added
        gintRowClicked = frmReminder.gridMaster.row
    End If
    '******* Q28843339A End *********
    
    Label6.Caption = calDate: old = Index

    gstrTaskEntryDate = Label6.Caption
     
    If mbFormIsLoading = False Then
'          If mEditMode = True Then
'              frmReminder.gridMaster.TextMatrix(mEditRow, 1) = Label6.Caption
'                'put the date seleceted into the correct cell in frmreminder.gridMaster
'
'            frmReminder.Visible = True
'        End If
        gstrTaskDueDate = Label6.Caption
        'MsgBox Format(CDate(Label6.Caption), "mm-dd-yyyy")

        Unload Me
        
        Exit Sub
    End If
    
     Select Case gintOptionIndex ' frmChooseOption.miOptIndex
      Case 0
          txt = "Every Day"
      Case 1
          txt = "Every Week on  " & gstrTaskEntryDate
      Case 2
         txt = "Every Month on " & gstrTaskEntryDate
      Case 3
          txt = "Every Year on  " & gstrTaskEntryDate
       Case 4
          txt = "One time reminder " & gstrTaskEntryDate
      
    End Select
      
    If mEditMode = True Then 'put the new date into the grid
        frmReminder.gridMaster.TextMatrix(gintEditRow, gintEditColumn) = Format(CDate(Label6.Caption), "mm-dd-yyyy")
        '  frmReminder.gridMaster.TextMatrix(gintEditRow, gintEditColumn) = Replace(Label6.Caption, "/", "-") ''Format(Label6.Caption, "##-##-####")
    End If
    
    NewDate = Format(CDate(Label6.Caption), "mm-dd-yyyy")
    
    EntryDate = Format(Now, "mm-dd-yyyy")
    
    gstrNewFileName = gstrFileNamePrefix
    If gbNewTask = True Then
        gstrTaskEntryDate = NewDate
        If mbAllowFormUnload = True Then Exit Sub
        mbAllowFormUnload = True
        ' Unload Me
        Me.Visible = False 'hide the form
        Unload frmChooseOption
'       frmChooseOption.Visible = False
    End If
  
End Sub

Open in new window


I added these in basMain. Feel free to move them to another code module if you like.
'******* Q28843339A Start *******
Public gintRowClicked As Integer
Public gintLabel1Index As Integer
'******* Q28843339A End *********

Open in new window

isnoend2001Author Commented:
thanks that works
isnoend2001Author Commented:
My next question will be to make the first column work the same .i will post it
I have changed the date format from 09/25/2015 to 09-25-2016 like column 3
i will post the question
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.