Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Matthew Olson
  Where is Matthew Olson?
 Manhattan
 Kansas - United States
 Matthew Olson
 Tags
Subject: oddities on a form
Thread ID: 311206 Message ID: 311206 # Views: 58 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Wednesday, June 29, 2011 4:48:19 PM         
   


There are two issues that have either gone unnoticed for a long time or are just now showing on this form. I have a table of Instructors and have a form to add/edit the Instructors. These Instructors may have a Firm assigned to them and an ID to the Firm table is issued into the Instructor record.

As you can see in the image below the Firm does properly show and gets placed in the record. I can look at the table and see the proper Firm ID is in place. In a double click event of the Firm field is a procedure to open a form with the Firm record. I utilize this exact same procedure elsewhere and it works fine. The Firm ID is passed to the Firm form and a Seek is done to find the record and display it. For some reason, the ID is never found and the record obtained is the EOF record.

Now even odder is that if I put a Set Step On, the proper Firm is found and showed. So, I can't properly trace the problem.

The other thing with this form is that the DataNav arrows just sit there disabled (and you can see them in the image as well). They are the same DataNav buttons that are used on many of my other forms. The skiptable is set to the correct table, so I can't figure out why they aren't enabled. They show enabled properly if I Set Step On.

I will appreciate any help that can be given me. Code is listed below the image. I am willing to answer any questions you have for me.

Thanks,
Matthew





Double click:
LOCAL oFirm
SELECT firm
SET STEP ON
=SEEK(INSTRUCT.INfmid, "firm", "FIRMID")
nFirmRec=RECNO('firm')
SCATTER NAME oFirm
=thisform.mShowFirm()



mShowFirm:
If Instruct.INfmid<>'999999999999' And Instruct.INfmid<>'888888888888'
* Thisform.lCallFirm=.T.
Select firm
Do Form fFirm With '','',Instruct.INfmid To test
Thisform.lChanged=.T.
Select Instruct
Endif



ffirm.Init:
PARAMETERS cFirm, cVend, cFmid, lOnlyVend, lNew
EXTERNAL ARRAY aSetFilt

SET MULTILOCKS ON
thisform.lchgfirmname =.F.
CURSORSETPROP("Buffering",5,"Firm")
SELECT firm
IF !(SET('PROCEDURE')$'TLA_FUNC')
SET PROCEDURE TO tla_func ADDITIVE
ENDIF
IF !(SET('LIBRARY')$'JKEY50')
SET LIBRARY TO jkey50 ADDITIVE
ENDIF
IF UPPER(aSetFilt[1])='FIRM'
THIS.acepgf1.page1.lblFilter.CAPTION=' Filter='+aSetFilt[2]+' '
ELSE
THIS.acepgf1.page1.lblFilter.VISIBLE=.F.
ENDIF

THISFORM.acepgf1.page1.txtFmphone.INPUTMASK=xc_phopict
THISFORM.acepgf1.page1.txtFmfphone.INPUTMASK=xc_phopict
THISFORM.acepgf1.page3.txtFmbphone.INPUTMASK=xc_phopict

SELECT firm
IF lOnlyVend
IF UPPER(aSetFilt[1])='FIRM'
SET FILTER TO fmident='V' AND fmid<>'888888888888' AND fmid<>'999999999999' AND &aSetFilt[2]
ELSE
SET FILTER TO fmident='V' AND fmid<>'888888888888' AND fmid<>'999999999999'
ENDIF
LOCATE
ELSE
IF UPPER(aSetFilt[1])='FIRM'
SET FILTER TO fmid<>'888888888888' AND fmid<>'999999999999' AND &aSetFilt[2]
ELSE
SET FILTER TO fmid<>'888888888888' AND fmid<>'999999999999'
ENDIF
LOCATE
ENDIF

IF !EMPTY(cFirm)
THISFORM.mAdd()
REPLACE firm.fmfirm WITH cFirm
IF TYPE('cVend')='C'
REPLACE fmident WITH cVend IN firm
ENDIF
THISFORM.lChanged=.T.
ENDIF

IF TYPE('cFmid')='C'
IF !EMPTY(cFmid)
SELECT firm
=SEEK(cFmid,"firm","FIRMID")
*!* THIS._datANAVBTNS1.VISIBLE=.F.
*!* THIS.cmdAdd.VISIBLE=.F.
*!* THIS.cmdFind.VISIBLE=.F.
*!* THIS.cmdDelete.VISIBLE=.F.
ENDIF
ENDIF

IF lNew
THISFORM.mAdd()
THISFORM.lChanged=.T.
ENDIF

ENTIRE THREAD

oddities on a form Posted by Matthew Olson @ 6/29/2011 4:48:19 PM
RE: oddities on a form Posted by Liaqat Ali GB @ 6/29/2011 9:04:28 PM
RE: oddities on a form Posted by Matthew Olson @ 6/29/2011 9:15:30 PM
RE: oddities on a form Posted by Liaqat Ali GB @ 6/29/2011 9:39:08 PM
RE: oddities on a form Posted by Matthew Olson @ 6/29/2011 10:03:25 PM
RE: oddities on a form Posted by Liaqat Ali GB @ 6/29/2011 10:21:10 PM
RE: oddities on a form Posted by Matthew Olson @ 6/29/2011 10:30:42 PM
RE: oddities on a form Posted by Mike Yearwood @ 6/29/2011 11:03:18 PM
RE: oddities on a form Posted by Matthew Olson @ 6/29/2011 11:26:34 PM
RE: oddities on a form Posted by Mike Yearwood @ 6/29/2011 11:31:24 PM
RE: oddities on a form Posted by Matthew Olson @ 6/29/2011 11:59:27 PM
RE: oddities on a form Posted by Mike Yearwood @ 6/30/2011 12:01:26 AM
RE: oddities on a form Posted by Tamar Granor @ 6/30/2011 10:25:20 PM
RE: oddities on a form Posted by Matthew Olson @ 6/30/2011 10:29:21 PM
RE: oddities on a form Posted by Tamar Granor @ 7/1/2011 10:17:34 PM
RE: oddities on a form Posted by James Frye @ 7/2/2011 5:25:41 PM
RE: oddities on a form Posted by Anders Altberg @ 7/2/2011 7:31:29 PM