keepingbusy
Programmer
Hi
This is a duplicate posting from the Microsoft: VFP -General Coding Issues that I have been requested to show here.
Before you look at it, I had some replies on the original thread. The second issue about not wanting anyone to add thier own description has been resolved by changing the combo box style property to 2 - Dropdown List
Whilst trying to develop this, I have another question as 3 below.
Original Post:
Sorry if this seems easy to you guys, but I've not had much call in the past to use combo boxes on a form and the help file (as usual) doesn't give you much info.
I have used the following with advice from another thread to create an array:
The combo box on the forms works fine having used the builder to allow the combo box to be populated with the array data from the table called scodes but here are my issues:
1. When the form runs, I need the first record in that array to show as the first line in the combo box
2. I do not want to allow anyone to add their own descriptions into that combo box (only allow the choices from the array)
3. The the scodes.dbf has two fields shortcode and codedesc An example of one of the records is OPTION1 in the first field and 2006 in the second field. One of the records I've used the builder on the combo box to allow the first field from another table to be populated by the selection from the array when the user selects it from the combo box. If I want the second field to be populated in the secnd table from the array when the user selects the first, how is that accomplished? Can the builder do it?
Some guidance not the sollution would be appreciated.
Version VFP9
Many thanks as always.
Lee
This is a duplicate posting from the Microsoft: VFP -General Coding Issues that I have been requested to show here.
Before you look at it, I had some replies on the original thread. The second issue about not wanting anyone to add thier own description has been resolved by changing the combo box style property to 2 - Dropdown List
Whilst trying to develop this, I have another question as 3 below.
Original Post:
Sorry if this seems easy to you guys, but I've not had much call in the past to use combo boxes on a form and the help file (as usual) doesn't give you much info.
I have used the following with advice from another thread to create an array:
Code:
DIMENSION shortcodes(1)
IF file("scodes.dbf")
SELECT shortcode FROM scodes ORDER BY shortcode ;
INTO ARRAY shortcodes
ENDIF
The combo box on the forms works fine having used the builder to allow the combo box to be populated with the array data from the table called scodes but here are my issues:
1. When the form runs, I need the first record in that array to show as the first line in the combo box
2. I do not want to allow anyone to add their own descriptions into that combo box (only allow the choices from the array)
3. The the scodes.dbf has two fields shortcode and codedesc An example of one of the records is OPTION1 in the first field and 2006 in the second field. One of the records I've used the builder on the combo box to allow the first field from another table to be populated by the selection from the array when the user selects it from the combo box. If I want the second field to be populated in the secnd table from the array when the user selects the first, how is that accomplished? Can the builder do it?
Some guidance not the sollution would be appreciated.
Version VFP9
Many thanks as always.
Lee