I am trying to figure out how to turn one of my TextBoxes into a drop down box with choices.
On my Item Card I have "Fabric Types" and you can drop down and select your fabric.. Rayon, Cotton, Sheer, Silk..
On another tab you guys helped me setup something earlier so I can have Catalog, Year, and Page number. I'd like Catalog to have a drop down box which contains selections PB, PC, PL, SP.
I looked at the code for Fabric Type and changed my Catalog to have OptionString ,PB,PC,PL,SP but that idd not work.
0
Comments
Do a processing only report - that transfers the values from the incorrectly setup catalog field.
catalog2 := catalog;
modify;
then you'll feel better that you don't have to do all the work again.
Then delete the old catalog field - change the name of catalog2 to catalog.
it's like a switcharoo - you know what I mean?
http://www.BiloBeauty.com
http://www.autismspeaks.org
1 - add a new field, make it option type
2 - create a routine that sets the new field to corresponding values to the existing field
3 - validate the values
4 - create a routine that blanks out the existing field
5 - change the type of existing field to option, and run a routine to transfer the values from the new field
or variations of this, there's more than one way to do it.
<edit> like Harry says a "switcheroo" </edit>
RIS Plus, LLC
Currently it only allows two characters, but if someone types it wrong then it won't show up on reports, or if someone types in lowercase when we're using only uppercase.
Now that I think about it, they might not like only being able to choose certain things. If I'm not working here in the future they won't know how to change things.
Well next time - or perhaps when you have free time.
It's not that hard to do. if you think about.
So Use Option type in the future if you want to assign set choices
or CODE type if you have entry field you want uppercase always.
Not as good as actual "option" - but on the form if you edit the property ValuesAllowed for that field
to PB;PC;PL;SP then that's all you can type into that field.
or to force Uppercase:
Property->CharAllowed
Use this property to set the range of characters you will allow the user to enter into this field or text box.
For example, if you want users to type only uppercase letters in this field, enter AZ
Your report would be something like this.
Create A new field in the item table called Catalog2 - type option with options ( ,PB,PC,PL,SP)
Dataitem - ITEM
OnAfterGetRecord()
IF Catalog = 'PB' THEN Catalog2 := Catalog2::PB;
IF Catalog = 'PC' THEN Catalog2 := Catalog2::PC;
IF Catalog = 'PL' THEN Catalog2 := Catalog2::PL;
IF Catalog = 'SP' THEN Catalog2 := Catalog2::SP;
MODIFY;
run the report - physically view that the new field has values so you don't need a Xanax.
Now you have the values in both places.
then you can use the same report just comment out the "if" code above using //
Add Clear(Catalog);
run again. now all your calalog values are clear. remove field from form so you don't get an error later on when you try to open the item card (not a hard fix if you don't do this).
Now edit the Catalog Field - change it to type option Just like the Catalog2 field.
Edit the report to copy the values from Catalog2 back to Catalog.
a) or just delete catalog and rename catalog2 to catalog. Fix desired reports.
b) now if copies to orig field then clear cat2 & delete field.
basically, in,a,round,about,way.
http://www.BiloBeauty.com
http://www.autismspeaks.org
YOu can always filter with a report. so you can make some test items and filter on those to make sure what you doing is working correctly. A seperated test envion is always good.
http://www.BiloBeauty.com
http://www.autismspeaks.org