Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems creating a wizard style form
Message
General information
Forum:
Visual FoxPro
Category:
CodeMine
Title:
Problems creating a wizard style form
Miscellaneous
Thread ID:
00835822
Message ID:
00835822
Views:
53
Hi all,

I'm building a form with VFP8 and Codemine7.1 for the sales staff to add new clients. The form has several tables in the DE. Using the wizard format so certain procedures are always followed. Inserting the data into the table was working and then stopped.
In the form.activate I have the following:
SELECT clients
APPEND BLANK
DODEFAULT()
The only thing that has changed is some code added to the cmdNext.Click
IF thisform.pgfSteps.ActivePage = 1	
LOCAL cPrefix, cSuffix, nIncrement, cCmpCode, nCurRec, cPrefixVar, cCmpName
*** Create the client code from the first three letters of the LastName
*** if it is Residential, or the first three letters of the CompanyName
*** if it is Commercial

*** variables
nCurRec = RECNO()
nIncrement = 10
cSuffix = STR(nIncrement)

*** retrieve the result of the optiongroup choice to use as a suffix
DO CASE
	CASE thisform.pgfSteps.page1.opgClientClass.Value = 1
		cPrefixVar = thisform.pgfSteps.page1.txtLastName.Value
	CASE thisform.pgfSteps.page1.opgClientClass.Value = 2
		cPrefixVar = thisform.pgfSteps.page1.txtCompanyName.Value
ENDCASE
cPrefix = SUBSTR(cPrefixVar,1,3)

*** check for existing cmp_code
SET ORDER TO 1
DO WHILE nIncrement < 1000
	IF nIncrement < 100
		cSuffix = "0"+ STR(nIncrement,2)
	ELSE
		cSuffix = STR(nIncrement,3)
	ENDIF  
cCmpCode = ALLTRIM(cPrefix) + (cSuffix)
	LOCATE FOR  cmp_code = cCmpCode 
	IF NOT EOF()
		nIncrement = nIncrement + 010
		LOOP
	ENDIF
	EXIT
ENDDO

*** create the name and insert it into the record. if the choice is commercial,
*** insert the name as it is in the textbox, other wise cat the values into the 
*** LastName, FirstName string and insert into the record.
DO CASE
	CASE thisform.pgfSteps.page1.opgClientClass.Value = 1
		cCmpName = thisform.pgfSteps.page1.txtLastName.Value ; 
                    + ", " + thisform.pgfSteps.page1.txtFirstName.Value
	CASE thisform.pgfSteps.page1.opgClientClass.Value = 2
		cCmpName = thisform.pgfSteps.page1.txtCompanyName.Value
ENDCASE
thisform.pgfSteps.page1.txtClientName.Value = cCmpName
thisform.pgfSteps.page1.txtClientCode.Value = cCmpCode
ENDIF

DODEFAULT()
Now the code fires and creates the values that I want (I watched in the debugger), but when I go to page 2 of the wizard all the controls that that have a control source are dimmed. If I just next, next, through the rest of the wizard, when I look at the table a blank record has been added. So how do I get the forms controls to be positioned on that blank record? Or do I need to not set control sources and just replace or append all the data collected on the form's close before it is released.
Opportunity is missed by most people beacuse it is dressed in overalls, and looks like work --- Thomas Edison
Next
Reply
Map
View

Click here to load this message in the networking platform