Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form wizard
Message
From
20/11/2001 03:20:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00583429
Message ID:
00583784
Views:
41
>>>>>>Jim, This form will be used by several dbfs, all with the same structures.
>>>>>
>>>>>After you do the d and d remove the alias from the controlsource properties. Then remove the dbf from the de.
>>>>
>>>>Well that's just it, the D & D x50 is ok, but removing the alias x50 could be quite cumbersome.
>>>
>>>Timothy,
>>>
>>>You would only have to do the 50 times one time though. It seems like a lot, but once you're done, you're done. Probably only take about 15 minutes really.
>>>
>>>Renoir
>>
>>Hi Renoir :)
>>He shouldn't one-by-one IMHO. Select all in DE, drag with right button and select 'Create multiple controls here'.
>>
>>Then select any one control on form and run :
>>
>>
aselobj(arrForm,1)
>>for each oControl in arrForm[1].Controls
>> with oControl
>> if upper(.Baseclass)='TEXTBOX' and !empty(.Controlsource)
>>   .ControlSource = substr(.Controlsource, at('.',.Controlsource)+1)
>> endif
>> endwith
>>endfor
Cetin
>
>Cetin, I have 50 fields, I only only visually access 18, whcih is how many can be displayed with my designer form maximized. Even if I scroll or resize! :(

Tim,
For the method to work you don't have to see them. As you drop them all are selected but doesn't matter. You could select any control on form and method does its work. Rest is a design point.
Actually I was in a hurry when I wrote it. In your case I possibly would take another approach and temporarily create a table with a nonexistant unique name ie: oRecord. I would out it in DE just to be free with drag&drop (not mandatory though). When I create my interface possibly with pageframes or form scrollbars all controlsources would have 'oRecord' as an alias. Then I don't need 'oRecord' table anymore. I'd delete it. Run a slightly modified version of that code to add 'thisform.' in front. A controlsource would look like 'thisform.oRecord.FieldName'. Then I'd create 2 methods, showrecord-saverecord.
ShowRecord would :
scatter name thisform.oRecord memo
SaveRecord would :
gather name thisform.oRecord memo

In its simple form. My navigator, pointermover method would take care of calling ShowRecord, SaveRecord as appropriate. With identical structures this approach is free from knowing actual alias.
You could make it a property of form and open, navigate as needed.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform