>Hello all
>I am using FoxPro 7 and have need to access data from another system both systems are made by us.
I have the main system which I am working on with its own forms and its own database. I need to access information from a different system with has a free table with information I need (to capture the reference from it).
1) When I load up my form I have a combo which needs to show the free tables name and narrative. How do I do this? I tried using a SQL statement but it needs the table. Can I add this table to the data environment but then where will the users have the systems i.e. paths and drives. I added a field in system definition to capture and save the path of the new system. But then I can’t add the free table to the data environment can I?
2) Next to the combo is added a command button (search facility) and a disabled textbox.
When the command button is clicked a new form is opened with a grid showing all the names and narratives from this free table. I should be able to select one record and this value gets captured(in a variable name) and on release of this form we come back to the original form which shows this captured value in the disabled textbox
>That’s all
>Can anyone help please?
Open the free table from the other APP, by loading it from your form then issue a
SQL select statement INTO TABLE. The other app should be Multi-user compliant, then from your result query, you load to your data environment the temporary table you have created.
Click Event from command button
Do form your_name with cVar
Then from the next form, store all the fields to variables, since you have Grid on the second form, you can stuff the fields of the table into variables
Under keypress event on text1 of your grid's column control,
You can put something like
If nKeyCode = 13
Select Table_name
field1 = cVar1
field2 = cVar2
field3 = dVar3
field4 = nVar4
lget = .T.
Thisform.release
ENDIF
then on its
Unload EventIf lget
cVar1 = cVar1
cVar2 = cVar2
dVar3 = dVar3
nVar4 = nVar4
Else
cVar1 =""
cVar2 = ""
dVar3 = ""
nVar4 = ""
Endif
Or you can select the table from the form with the grid, then stuff all the fields to your first form...
Note: both form should be modal