Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql RowSource with a reference of an Entry Field
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00042167
Message ID:
00042289
Views:
32
>>We want to write a SQL statement in a ComboBox RowSource with a Where clause depending of an Entry Field of the same Form.
>>
>>The only way we have found is to put the EntryField.value in a Public Variable and do :
>> Select field1 from Table1 Where Table1.Field2 = PublicVariable
>>
>>It does not work when we want to do :
>> Select field1 from Table1 Where Table1.Field2 = ThisForm.EntryField1.Value
>>
>>If someone have an idea about the right syntax !!!
>>
>>Analystik team.
>
>local lcGetValue
>lcGetValue = thisform.entryfield1.value
>
>select field1 from table1 where table1.field2 = lcGetValue
>
>need to use a var because sql has problems with this.anything

Dave,

You are right, VFP does not understand "this.anything".

But, it does not work with "local lcGetValue" ... because the only thing it's possible to enter in the RowSource property is a SQL statement and not "local lcGetValue" and "lcGetValue = thisform.entryfield1.value".

Analystik team.
Analystik Team
1430 Belanger
Montreal (Quebec)
Canada
(514) 278-2727
analyste@analystik.ca
Previous
Reply
Map
View

Click here to load this message in the networking platform