Prompt method not working

I’ve got a section of code that asks three things from the user:

Date of a meeting, a charge number, and to select a previous date from a list generated by the code (so we can pull the old data and it can be updated). It looks like this:

reviewdatestr = uiws.Prompt ( 3 , "Date" , "What is the date of the review meeting? (MM/DD/YYYY)" )

reviewdatestr = Format ( Cdat ( reviewdatestr ) , "General Date" )



If reviewdatestr = "" Then Exit Sub



gostr = uiws.Prompt ( 3 , "GO" , "What is the GO Number for which you wish to create a program review chart?" )



If gostr = "" Then Exit Sub

'=================================================

'Find out which review they want to pull the archive data from

vardatelist = Evaluate ( "@DbColumn( Notes : ""NoCache"" ; """" : """" ; ""Program Review"" ; 1 )" )

strfromwhen = uiws.Prompt ( 4 , "Last Review" , "Select the date of the last review from the following list:" , "" , vardatelist )

’ strfromwhen = uiws.Prompt ( 3 , “Last Review” , “Enter the date of the last review:” , “” )

If strfromwhen = "" Then

	  intresp = uiws.Prompt ( 2 , "No Previous Date Chosen" , "You did not select a previous review date. Do you want to create blank charts?" )

	  If intresp <> 1 Then Exit Sub

	  varuselast = False

Else

	  varuselast = True

End If

Everything works but the last Prompt (type 4). It comes up and asks for all the data just like I expect it to. The commented out line below it is a test I did - can I put a type 3 (OKCANCELEDIT) in there and have it work? Yes, I can.

When this has happened before it’s always been because I made a typo or a structural mistake in the prompt code. I’ve recreated it, copying directly from the section of the help files. No change, it still doesn’t work.

The really frustrating part is, it worked yesterday. I tested it, and it asked me. I came in this morning and it didn’t work. I’ve debugged and vardatelist is populated with my values, everything is doing just what I want it to, it just skips over the code where I want them to get a list so they can choose a previous date.

Anyone have any ideas? This is so basic, and I’m just not getting what the problem could be.

Subject: Prompt method not working

I think you have to have a default value. That “” (before vardatelist) I believe has to be a valid value that is actually contained in vardatelist.

strfromwhen = uiws.Prompt ( 4 , “Last Review” , “Select the date of the last review from the following list:” , “” , vardatelist )

Subject: RE: Prompt method not working

I’ve got the same code elsewhere, and it doesn’t require a value.

The really strange thing is, the production version of this database also has this exact line, and it works. That database is on another server. I’m doing this on our test server.

Subject: RE: Prompt method not working

Scott,it works on one server, but fails on another, correct?

I know you already thought about this, but does the server it is failing on have access to all the information? Being it’s ui code, do you have access to the information on the test server?

This really is a strange one, wished I had something else to offer.

Subject: Found the problem

and it’s so basic I feel stupid.

This whole thing is relatively new, so we only have data from about February to now in the production database. While testing on the test server I ran the (bogus) data up to about mid-year 2008 and noticed that one view was sorting wrong. I had it displaying as text instead of a date value. Simple change to a formula and all was good.

Except that was also the view I was using in my @DbColumn formula, and it was no longer returning text values, it was returning date values. That’s why the prompt line was choking - I wasn’t supplying it with an array of text choices. Added some code to convert it to text and there it goes, just like it’s supposed to.

Sometimes it’s the little things that creep out and give you bloody ankles.

Subject: where does it fail?

Using the debugger, where does the code fail?

Is each prompt presented to get a response or is the code exiting the sub for some reason?

Subject: RE: where does it fail?

It doesn’t give me any error message, it just skips the step. I’ve had the debugger open every time I’ve run it.