Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create Popups from fields in screen builder

Status
Not open for further replies.

sarahblovely

Programmer
Dec 9, 2002
8
0
0
CA
I want to create a popup using records in a dbf file with the screen builder. I see how this can be done writing code using Prompt Field but in the screen builder you can either choose from an array or list the prompts. The variable buton seems to lead to you to an area to select a dbf field but I don't understand how the value is stored. All I want is a popup of customer names from which they can make their choice. This value would then be used to create a filter on the next popup which would include open orders. I want to use the dbf files so I can change the filters depending in their selections. Please Help
 
Use the 'List Popup' radio button, the for the variable use your table field. Like MyTable.Customer.
Dave S.
[cheers]
 
What do I then put in the promp section. If I put nothing ad then choose ok the popup disappears in the screen builder. If I put anything else as a promp it shows only that as a selection and the identifier - myfile.customer. I don't understand what should go in the prompt section as it is active when you choose the list option.
 
Sorry, I was thinking of something else and got confused.
For a popup, use an array. In your 'Setup' snippet, add something like:

STORE 0 TO cbValue
SELECT SomeField FROM SomeTable INTO ARRAY MyArray

Then in your popup, use the 'Array Popup' radio button, with MyArray as the array. Now put cbValue in the box next to the 'Variable' button. When a selection is made, cbValue will hold the index of the array. You can then use MyArray[cbValue] to display the text, or cbValue to get which item number it is. Test it by putting:

WAIT WINDOW MyArray[cbValue] NOWAIT
RETURN .T.

in the Valid snippet of the popup.
In order to use the table itself, use a listbox istead of a popup.
Dave S.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top