Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Type Mismatch - ComboBox
Message
From
05/05/1998 12:27:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00096648
Message ID:
00097060
Views:
20
>>>I have a combo box set up as a listbox which is tied to a date field in a table (vitals). I am opening the table and setting the index to date (descending order) and then I am filtering the table in the init event to the dates related to a particular patient id (this is a child table for vital signs which are taken at different dates for different patients)
>>>
>>>When I run the form, I get the following error:
>>>
>>>"Error with cmbVitalsDate - Value: Data type mismatch."
>>>
>>>Any idea why? BTW, I do not have anything in the value property and when I init the combobox, I attempt to load the first date value in the combobox so that it instantiates with the most recent date for the patient displayed.
>>>
>>>TIA,
>>>
>>>Bill
>>Bill,
>>Combo elements have char type. How do you set it init - with dtoc() ?
>>Cetin
>
>
>OK, I did what Ed suggested, deleted the controlsource property and left the row source as dtoc(vitals.date). What I can't seem to do is get the first element in the list to display in the box when it inits. I set the displayvalue to dtoc(vitals.date) and the value to the same and refresh. All other fields of the same record are popping up on the form. Don't understand this one either.
>
>It's not critical for this to display. Would look a lot nicer though. Any thoughts?

If you have Combo.Rowsourcetype=6 (fields) and .Rowsource="table1.field1,field2" then you will see field1 value in text protion of combo (displayvalue property), but combo.value will depend on Combo.Boundcolumn setting, e.g. if it's 2 then value is getting from table1.field2, etc. To set initial value. it's enough to say Combo.Value="some_value_fromrowsource", and you don't need in DTOC!
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform