General information
Category:
Coding, syntax & commands
>I've been out of VFP for several months and have forgotten a few things about the environment. If I have 2 tables open with a form but with no relation set between them and one of the textboxes on my form will display a field from the secondary table based on a field from the other, can I use a select statement to show the corresponding value based on a key field in the current record ? I did this with a combobox I used a select statement into a cursor to prevent changing the current work area.... can I do a similar thing with a textbox ?
Sure when the record changes in the first table (or whatever event that happens that will change the value in the textbox) just do select or a find to get the value to stuff into the text box. Example:
* get the approriate value in table2
select avalue from table2 where table1thingy = table2.something into cursor1
* assign the value to the textbox
mytextbox.value = cursor1.avalue
Just a question... how come you are letting relations in the dataenivronment do the work for you?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only