Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompt edits

Status
Not open for further replies.

DanNorris2000

Technical User
Nov 10, 2000
186
US
WHERE Ledger.pc = "PF";
AND pool.POOLTYPE > 19;
AND Ledger.ctrpoolno<>50087;
AND Ledger.ctrpoolno<>90819;
AND Ledger.ctrpoolno<>90829;
AND Ledger.bookper <= ?'Booking Period (YYYYMM)';

Is there a way to do any edits on the booking period prompt above?. Perhaps check date against a range or test for validity and length?
 
If you mean run some code on the little ODBC parameter value entry dialog box that pops up, no. You'd have to do all your validation before the statement is executed.

Robert Bradley

 
Have you tried the Between() command
WHERE Ledger.pc = &quot;PF&quot;; .........
AND [red]between(Ledger.bookper, date2, date3)[/red] David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
I changed the way I was trying to do this. I created a form inserted a text box, named &quot;txtbookper&quot; in the form and made it only except numeric. In my program I have a
&quot;do form k:\vfp98\bookprompt.scx&quot; statement. The form pops up and I enter 200005 (year and month) in the text box when I hit enter(hide.frmbookprompt) it returns to the program but it obviously doesnt like the following part of my SELECT statement: AND Ledger.bookper <= txtbookper

Have I incorrectly identified the value of what I typed in the textbox ? does it have to be frther defined in the program? Compile was successful
 
Once you hide the form, use this code:

[tt]nYearMo = frmbookprompt.txtbookper.value[/tt]

and change the end of your select statement to:

[tt]AND Ledger.bookper <= txtbookper[/tt]




Robert Bradley

 
AND Ledger.bookper <= txtbookper

I think this is a typo. If I'm not mistaken, I think Robert meant to type:

AND Ledger.bookper <= nYearMo Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Open database mrcdata
do form frmBookprompt

behind command1 click event on form:

frmBookprompt.hide
nYearMo = frmBookprompt652.txtbookper.value

In Select statement :AND Ledger.bookper <= nYearMo;

I get SQL:Column 'NYEARMO' not found
 
I suppose, should be:

AND Ledger.bookper <= ?nYearMo

if nYearMo is memory variable. To assure it is public:

Open database mrcdata
public nYearMo
do form frmBookprompt



Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Works like a champ, thanks to all. Did have to Val(nYearmo) for it to work
 
Yeah, yeah, yeah. Thanks, Jon and Vlad...chalk it up to old age.

val(nYearmo)
You could get around this by setting the initial value of the textbox to 0, but there's no great advantage.

Robert Bradley

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top