Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Caption.label
Message
From
20/06/2006 03:31:11
 
 
To
19/06/2006 10:38:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01129949
Message ID:
01130155
Views:
13
HI,
thank you for reply,code and help,

>I think Q1 was a field in your table, right? In that case, the alias is probably not selected. Either select it first, or include the alias in the variable expression. In other words, your variable should contain, not "q1", but "dnc.q1".
>
>>hi,
>>thank you for replay and code,
>> i try as under i got error message variable q1 is not found
>>
>>USE answers IN 0
>>        SELECT answers
>>             for i = 1 to 3 &&  as example
>>  lcKeyField = "Q" + trans(i)
>>  thisform.text42.Value= lcKeyField && to check
>>   if ThisForm.List1.Value = eval(lcKeyField) && e.g., equal to Q1
>>    ThisForm.Label1.Caption = eval("DNC.Q" + trans(i)) && e.g., Q1
>>    ThisForm.Label2.Caption = eval("DNC.Q" + trans(i) + "1") && e.g., Q11
>>    *...
>>  endif
>>next
>>
>>Select answers
>>
>>thanks
>>
>>
>>>In your particular example, it seems practical to have variables which store the names of both labels, and table fields.
>>>
>>>Something like this:
>>>
>>>
>>>for i = 1 to ...
>>>  lcKeyField = "Q" + trans(i)
>>>  if ThisForm.List1.Value = eval(lcKeyField) && e.g., equal to Q1
>>>    ThisForm.Label1.Caption = eval("DNC.Q" + trans(i)) && e.g., Q1
>>>    ThisForm.Label2.Caption = eval("DNC.Q" + trans(i) + "1") && e.g., Q11
>>>    ...
>>>  endif
>>>next
>>>
>>>
>>>>hi all,
>>>>
>>>>i need your help,
>>>>i try to change many lables at my form , depend field value as under,
>>>>
>>>> USE answers IN 0
>>>> SELECT answers
>>>>&&&&my field name is QUESTION have q1 to q15
>>>>
>>>>           IF THISFORM.LIST1.Value=answers.QUESTION=Q1  &&  example
>>>>USE DNC IN 0
>>>> SELECT DNC
>>>>                 THISFORM.LABEL1.CAPTION=DNC.Q1
>>>>                 THISFORM.LABEL2.CAPTION=DNC.Q11
>>>>                 THISFORM.LABEL3.CAPTION=DNC.Q12
>>>>                 .
>>>>                 .
>>>>                 .
>>>>
>>>>             else
>>>>           IF THISFORM.LIST1.Value=answers.QUESTION=Q2
>>>>             *******************
>>>>                 THISFORM.LABEL1.CAPTION=DNC.Q2
>>>>                 THISFORM.LABEL2.CAPTION=DNC.Q21
>>>>                 THISFORM.LABEL3.CAPTION=DNC.Q22
>>>>                 .
>>>>                 .
>>>>                 .
>>>>
>>>> ENDIF
>>>>endif
>>>>         Select answers
>>>>
>>>>
>>>>thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform