Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically add a table to data environment
Message
 
 
To
04/06/2001 09:20:37
Fida Shamsoodeen
Combined Systems (Pty) Ltd
Centurion, South Africa
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00514484
Message ID:
00514542
Views:
12
This message has been marked as the solution to the initial question of the thread.
Then you just change the RecordSource of the grid to T0001.
lparameter tcNewSource && alias of the new record source
if vartype(tcNewSource) <> "C" or not used(tcNewSource)
   return .f.
endif
tcNewSource = alltrim(tcNewSource)
local lnI
local array laColumns[1]
with ThisForm.GridName
   dimension laColumns[.ColumnCount]
   for lnI = 1 to .ColumnCount
       if at(".", Columns[lnI]) = 0
          laColumns[lnI] = .Columns[lnI].ControlSource
       else
          * strip the alias name from the ControlSource
          laColumns[lnI] = justext(.Columns[lnI].ControlSource)
       endif
   endfor
   .RecordSource = tcNewSource
   for lnI = 1 to .ColumnCount
       .Columns[lnI].ControlSource = tcNewSource + "." + laColumns[lnI]
   endfor
endwith
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform