Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why the combo box doesn't show my display value?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Why the combo box doesn't show my display value?
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01077565
Message ID:
01077565
Views:
79
Hi everybody,

I can not understand what I'm doing wrong and why my combobox doesn't want to behave.

I have a form with a pageframe. On the first page I have a combobox to select a carrier for editting and also a new button. When I press New button, added carrier information, I obviously need to add this newly added carrier to my combo and I want to position my combo on this new value.

Here is the code in GetAllCarriers method which is executed in the postsavehook of the form (e.g. when the record was already saved in the table):
with this
	if .lGetAllCarriers
		.cboCarriers.rowsource = ''
		thisform.Carriers_biz1.lRequeryAllCarriers = .t.

		.lGetAllCarriers = .f.
		
		.cboCarriers.rowsourcetype = 2
		.cboCarriers.rowsource = 'crsCarriers_All'
		.cboCarriers.Requery()
		
		if not xEmpty(thisform.cSelected_Carriers_pk)
			.cboCarriers.value = thisform.cSelected_Carriers_pk			
		endif
	endif

endwith
The thisform.Carriers_biz1.lRequeryAllCarriers = .t. triggers the assign method of this biz object, which requeries the corresponding cursor addapter. After it's done I have the newly added record in the list, but it's not selected and the display value is still empty.

Do you know what could be wrong here?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform