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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP7: Screen.Visible and LPARAMETERS

Status
Not open for further replies.

cj001

Programmer
Oct 3, 2001
145
US
Hello!

Does the '_Screen.Visible = .F.' effect LPARAMETERS?

Because I now receive the error "variable 'xrange2' is not found" and I did not receive the error before I began using the 'Screen.Visible' command.

Is there away around this error?

Thanks!
CJ
 
cj001

Where are the parameters being used? Can you explain the sequence of events?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hello Mike Gagnon!

Sequences of events:
1. Startup program which has the '_Screen.Visible = .F.'. This program calls the login from.
2. The login form calls the Main Menu which is where the date range parameters are entered. Parameters XRANGE1 and XRANGE2.
3. Main menu calls the update form. This where the parameters are being passed to. XRANGE1 and XRANGE2 are used to filter the grid.

This update form contains 3 text fields (no controls), a combobox and a grid.

What's odd is when the user goes into the form everything is fine. If the user does anything with the grid first and then adds a record no errors occur.
If the user goes into the form and adds a record first the error "variable 'XRANGE2' is not found" occurs.



Below is my code for this screen.

UPDATE SCREEN ----------------------------------------------** INIT CODE
LPARAMETERS xrange1, xrange2, xckbgn
SET PATH TO C:\book, C:\book\data

SET DELETED ON
SET TALK OFF
Thisform.MinButton = .F. && Removes the Min Button
Thisform.MaxButton = .F. && Removes the Max Button
Thisform.Closable = .F. && Deactivates the little X

SET CENTURY ON
select chckbal
scan for chckbal.castrt = thisform.text1.Value AND chckbal.castrt = thisform.text2.Value
exit
ENDSCAN
xckbgn = cabbal

SELECT book
SET ORDER TO WIZARD_1
SET FILTER TO book.bbdate >= xrange1 AND book.bbdate <= xrange2
GO TOP
THISFORM.GRID1.Refresh()

WITH Thisform
.text7.value = xckbgn
SELECT book
.TXTDeprttl.visible = .F.
.TXTChkrttlp.visible = .F.
.TXTChkrttl.visible = .F.
.TXTAmtottl.visible = .F.
.TXTwrrttl.visible = .F.
.TXTeftrttl.visible = .F.
.text5.value = xrange1
.text6.value = xrange2
ENDWITH

** SAVE BUTTON CLICK --------------------------------
xacco = thisform.combo1.value
scan for Accounts.acdesc = xacco
exit
ENDSCAN
xcate = Accounts.cate
xcate = TRIM(xcate)
** -----------------------------------------------
** ------ SAVE -----------------------------------
** -----------------------------------------------
WITH Thisform
SELECT book
SET MULTILOCKS ON
= CURSORSETPROP('Buffering', 5, 'book' )
IF xcate = &quot;DEP&quot; then
sDate = .txtDate.value
sDesc = .Combo1.value
sDepAmt = .text1.value
Insert INTO book (bbDate, Desc, Depamt) values (sDate, sDesc, sDepAmt)
ELSE
IF xcate = &quot;PYR&quot; then
sDate = .txtDate.value
sDesc = .Combo1.value
sChkamtp = .text1.value * -1
sChknop = .text2.value
Insert INTO book (bbDate, Desc, Chknop, Chkamtp) values (sDate, sDesc, sChknop, sChkamtp)
ELSE
IF xcate = &quot;PAY&quot; then
sDate = .txtDate.value
sDesc = .Combo1.value
sChkamt = .text1.value * -1
sChkno = .text2.value && Payables No.
Insert INTO book (bbDate, Desc, Chkno, Chkamt) values (sDate, sDesc, sChkno, sChkamt)
ENDIF
ENDIF
ENDIF
= TABLEUPDATE(1,.T.)
thisform.recalc1
ENDWITH
** ------------------------------------------------
** --ADD-------------------------------------------
** ------------------------------------------------
WITH Thisform
zDate = .txtDate.Value
.text1.value = 0.00
.text1.Refresh()
.text2.value = ' '
.text2.Refresh()
.combo1.SetFocus()
ENDWITH



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top