Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Am I in a FORMSET?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Am I in a FORMSET?
Miscellaneous
Thread ID:
00353612
Message ID:
00353612
Views:
44
=MESSAGEBOX("TYPE OF THISFORMSET = " + TYPE("THISFORMSET"))
IF TYPE("THISFORMSET") = "0"	&& in a formset?
	IF THISFORMSET.DataSession = 2	&& private datasession
		oSearchDlog.nCurSessID = THISFORM.DataSessionID
	ENDIF
ELSE	
	IF THISFORM.DataSession = 2	&& private datasession
		oSearchDlog.nCurSessID = THISFORM.DataSessionID
	ENDIF
ENDIF
The diagnostic MESSAGEBOX displays TYPE OF THISFORMSET = O which is expected because the form is in a formset. But program execution proceeds to the ELSE and then gives an error on IF THISFORM.DataSession = 2 because a form in a formset has no .DataSession property. What is wrong here?

The Hacker's Guide and others say that formsets aren't worth using. But this code is in my framework, which ought to work with formsets in case they are used, even if I get rid of the one I have.

Is there a better way to check whether I am in a formset?
Next
Reply
Map
View

Click here to load this message in the networking platform