Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date() and combobox
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00257404
Message ID:
00257438
Views:
19
>1) i set date to dmy and i found that i cannot change it to any other format later on in the program. is there any way for me to display the date as dmy in one part and as ymd in another part of the program?
>

If it's a date and you're simply displaying it, you can convert to a yyyymmdd string pretty easily using DTOS(Date Expression). You should be able to change the date format on the fly in the application using SET DATE; realize that the setting is scoped to the datasession, so if you change it in a form with a private datasession, it won't carry over to another form with its own datasession.

>2) i put mytextbox.value = date(), therefore the value would be something like 25/08/1999. Now i want the date to appear in another textbox but as 19990825. how can i do that?
>

In the same form, you can only have one SET DATE in effect at any time, and that applies to all date display textboxes for that datasession. You could display the DTOS() of the date to have it appear as the second format as a string.

>3) i add a combobox as an object in my form using the following code:
>
> add object txtPartName as combobox with;
> rowsourcetype = 6, rowsource = 'part.partname', multiselect = .t.
>
> (part being the alias for my table and partname is the field in part)
>
>can anyone tell me if there is anything wrong with my approach and also, is there a way for me to sort the partname in ascending order?
>

The source table alias would need to be sorted on the field (eg the index on partname for the table would need to be active for the alias part.) You migth need to have the table in use twice with different aliases if you need more than one sort order in effect for referencing the table for lookup in the form. You can't use the ComboBox Sorted property with a RowSourceType of 6. IOW:

USE Parts ALIAS PARTS ORDER PARTNUMBER SHARED IN 0
USE Parts AGAIN ALIAS PartByName ORDER PARTNAME IN 0

and your rowsource would then become:

PartByName.PartName

to get the list sorted the way you want.

>last but not least, sorry for the many questions, but i'm desperate for help. thanks a lot for those who replied to my earlier messages. you guys really helped a lot.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform