Link to home
Start Free TrialLog in
Avatar of varvoura
varvoura

asked on

Q_21877553.html - type mismatch error

Hi Marko, everyone

I can't seem to get rid of type mistmatch error on the following line:

newList = Replace( oldList, MakeArray( fromDate ), MakeArray( toDate ) )

Tried not to declare newlist, hoping this will resolve the problem(no luck)
Tried to convert newlist to date value before setting it to form date field(no luck)

What can I do next??


      
ASKER CERTIFIED SOLUTION
Avatar of mbonaci
mbonaci
Flag of Croatia 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
Avatar of varvoura
varvoura

ASKER

Marko,

Version 6.5
I placed the code as is
I now moved Make Array to the global section of the view under declaration, but still no luck. Everytime I try to drag and drop, I get the type mismatch error on the line I sent earlier and the calendar entry stays in its original spot.

Something is going crazy here, but I am not sure what it is.
As I said, I used the debugger, still no help

Sorry!!
SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France 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
Marko, can you also clarify something for me:

At the moment, I have the following code to prompt before the drag and drop operation
(I've commented this out for now)

If Messagebox (Source.CalendarDateTime & Chr(13) & _
      Source.CalendarDateTimeEnd, _
      MB_YESNO + MB_ICONQUESTION, _
      "Is this the correct date where you want to move your test") = IDYES Then
            Continue = True
      Else
            Continue = False
      End If

this is to prompt with the date change.

Now I want to change it as follows so that it prompts user (YesNo) whether or not they wish to change all the subsequent test date for that specific product because of this date change. If they click "Yes" then change all the test date according to this one. If not, just leave all the other test entries as they are and only change this one.
There was an idea put down that this prompt (YesNo) should be based on a certain percentage of interval field but i am not sure how feasible is that.
For example,

If I have 10 test dates for a certain product, producta, with intervals of 120 days between those days. If I shift one of those dates 1 or 2 days forward or backward, then this is a small percentage of the interval and I shouldn't have to prompt to change all other entries, if however, the interval is 100 days and i shift this test 10 days forward then that's 10% of interval which is quite high and I should be prompt to whether or not all other non completed test entries should also move forward.
So it is based on percentage of interval.
The bad trick with this is that the testdates array always has all the testdates in it, whether completed or not and I'll have to be careful when I shift dates forward not to shift those completed ones so that they're rescheduled for testing again.

See the things that I have to do with my new job which I've only just started!!!!

Anyway, a bit of clarification on the above process will be great.




Hi sjef, yes oldlist exists and when I run the debugger, i can see all the dates populating correclty in oldlist

not sure what's causing this one!
Then try

    Dim fromList As Variant
    Dim toList As Variant
   
    fromList= MakeArray( fromDate )
    toList= MakeArray( toDate )
   
    newList = Replace( oldList, fromList, toList )

and use the debugger

Tried that, it crashes my lotus notes each time I try to drag an entry
NSD.....
Ah, I love those :) Then step through your code until you arrive at the statement it crashes on. Or set breakpoints when you think you can skip a lot of code.
That same line, whether setting newlist this way or Marko's way, still creating problems.
Marko's code throws type mismatch his newlist line and your newlist line causes NSD error

newList = Replace( oldList, fromList, toList )

said earlier, oldlist has values in it.
Would it have anything to do with the data type the that the date field on the document has?