Print Page | Close Window

Combobox with Database

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=10903
Printed Date: 20 September 2024 at 10:53am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Combobox with Database
Posted By: wismerhill
Subject: Combobox with Database
Date Posted: 04 June 2008 at 11:24am
Hello,

I have a combobox in the first column of a report control. The data source of this combobox is the result of a recordset :

RptControl_TA.Columns.Column(0).EditOptions.Constraints.Add RsTA.Fields("CODE_TA").Value & " - " & RsTA.Fields("LIB_TA").Value, i + 1


When i want to load the data, i add to the combobox column the following information (the same caption as before).
Record.AddItem RsListe.Fields("CODE_TA").Value & " - " & RsListe.Fields("LIB_TA").Value

But the combobox is empty.

I can only recover some information when i use Record.AddItem 1 (where 1 is the second parameter : i+1)

Can we use the caption to fill the combobox ?
Else i will need to use a tab to save the caption and the data code and research for each record the good caption.

Thanks



Replies:
Posted By: Aaron
Date Posted: 05 June 2008 at 2:34am
Hi,
 
Can you upload a sample?


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: wismerhill
Date Posted: 05 June 2008 at 3:29am
Of course,

I upload you a sample.

uploads/20080605_032849_Sample.zip - uploads/20080605_032849_Sample.zip


Posted By: wismerhill
Date Posted: 05 June 2008 at 5:34am
Thanks to Aaron, my problem was solved.

The solution is to declare for my combobox : Column.EditOptions.ConstraintEdit = False
 


Posted By: Aaron
Date Posted: 05 June 2008 at 6:23am
Hi,
 
I'm a little confused right now
 
I looked in the help (first time I didn't read it properly) and thought this is going to solve your problem and it did ?!?! but why, see Remarks
 

Remarks

If True, then you can only choose from the list of constraints added.

If False, then you can type a custom response not listed in the list of constraints.

 
Why does this property has an influence on this ???
Please explain....
 
 
And @wismerhill
This will have the same effect and you can only select the items in the combo:
 
''Column.EditOptions.ConstraintEdit = False
Column.EditOptions.AllowEdit = False
 
In the help:

Remarks

If False, then any editing features will not be used.  The Combo button and Expand buttons will not be displayed

If True, then all ReportRecordItems can be edited, you will need to set the EditOptions to false for each column that can not be edited, or you can set the EditOptions for each individual ReportRecordItem.

Now, this is helpfull isn't it?  
 
Well it works @wismerhill , right? Maybe we will get a reply of the supportteam and clear things....
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net