Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox ?

Status
Not open for further replies.

fluppe689

Programmer
Jul 11, 2008
75
BE
Hello Guys,

Something I did not have i my whole vfp live
I have cursor called tmp_gvert
It has been filled up

then is :
SELECT tmp_gvert
SET ORDER TO TAG vtnr
GO TOP
IF ! EMPTY(t_gem.vtnr)
LOOKUP(tmp_gvert.vtnr,;
t_gem.vtnr,;
tmp_gvert.vtnr,;
'vtnr')
WAIT WINDOW STR(tmp_gvert.vtnr)+Tmp_gvert.vtnaam
THISFORMSET.frmgem.pageframe1.page1.cb_vert.DISPLAYVALUE = tmp_gvert.vtnaam + " " + STR(tmp_gvert.vtnr,3,0)
THISFORMSET.frmgem.pageframe1.page1.cb_vert.VALUE = tmp_gvert.vtnaam + " " + STR(tmp_gvert.vtnr,3,0)
ENDIF

IN THE WAIT WINDOW EVERYTHIN OK
IN THE COMBOBOX EVERYTHING IS BLANK

WFG

FILIP
 
1. you're not using the same expression for the wait window and the combobox.

The combox is not a textbox, setting it's value to something not present in any record bound to it via it's controlsource makes it display what you see: nothing.

Eg if I bind the combobox to a cursor containing two records 1,"hello" and 2,"world", and the first column is the one the combobox is bound to then valid values are only 1 and 2. For 1 the combo does display "hello" and for 2 the combo displays "world", but for any other value the combo doesn't display anything, of course.

Combobox is a complex control,, it has a rowsource and a controlsource, two sources. Pay attention on how you set both things up. Besides that complexity combobox has several modes, combo (the one it's named after) but also dropdownlist only.

Bye, Olaf.
 
PS: your title say checkbox, in your text you say combobox. If we deal with a checkbox this can only display boolean anyway, so I think you rather mean a combo and so my previous answer is addressing the problem.

So, how is your combobox set up?

Bye, Olaf.
 
Hello Olaf,

I have done this already hundred's of times.
My combobox is set to dropdownlist.
My rowsource= tmp_gvert.vtnaam+ " " + str(tmp_gvert.vtnr,3,0)
My rowsourcetype = alias

I don't get why during the wait window the fields are still good and why during this displayvalue and value they are empty

wfg,

Filip
 
rowsource= tmp_gvert.vtnaam+ " " + str(tmp_gvert.vtnr,3,0)

An alias name can't have a space in it, this can't work!

Bye, Olaf.
 
Hello Olaf,

In all my other programs in which i work with dbc an dbf's it workds fine , it is not a name but 2 zones out of 2 cursor files,
the first is the name of the account manager, 2 second is the key of the temp file of the account manangers.

Wfg,

Filip
 
if you set the rowsourcetype to 2 (alias), then the rowsource must be an alias. There is no way around that. If you set the rowsource of other controls this way, take a look at them to see what kind of rowsourcetype you set there, but it can't be alias, that's for sure and there is no doubt that this can't work as alias.

Bye, Olaf.
 
hello Olaf,

I did mean 2 zones out of ONE cursor file

Wfg,

filip
 
What do you mean with zones???? Two field names?
An alias name is one name, the name of the workare, you can't specify two names, no matter what two.

If you want to specify field names the rowsourcetype must be fields and then you provide a comma delimited list.

Common, simply read the help on rowsource and rowsource type.

Bye, Olaf.
 
Hello Olaf,

So I do this already 10 years and it is the first time that this is not working properly
I will try to resume.
what I want to do is the following.
From sql server i make a cursor file getting the postcode (t_gem).
From sql server i make a cursor file getting the account managers (tmp_gvert)

tmp_gvert contains 2 zones vtnr and vtnaam (number and name)
in the combobox i try to put the vtnaam and vtnr from the chosen postcode, thats why i use a combobox with the above settings.

so the rowsource is the string from 2 zones : vtnaam + " " + str(vtnr,3,0)

When i do this in all my other programs(hundreds of them) this works fine but not here and the rare thing of it is when i do this wait window the output is good only when i do the expression with displayvalue and value the vtnr and vtnaam are set to blank.

so in short this is my problem

wfg,

filip



 
Again, I don't count this anymore: Rowsourcetype alias does not allow a two part rowsource. An alias name can't have a space in it. Whatever you mean with that two parts, it's not an alias name and you must use a different towsourcetype.

There is no doubt about that, no matter how often you say that do this for 10 years. An alias never allowed a space in it. If you have a file with a space in it's name, this is translated to an underscore.

Alias names don'T allow spaces, because spaces are seperators in foxpro commands, so if foxpro would allow spaces in alias names for example SELECT cAliasname would get ambigous.

"zone" is not a foxpro term, so tell what you mean with zones. If you mean parts of the table name of your backend, fopro will not use that same name as an alias. The alias is not a table or file name, it's the name of the workarea, and foxpro does not allow spaces in them.

Bye, Olaf.
 
Hello Olaf,

I mean with zones (this is dutch so i am sorry) is parts of a cursor file.

So may rowsource is a string build from 2 parts of a cursor file:
so the string i put in the rowsource = name of the accountmanager + a space + the string of the number of the account manager so the string could be : "FILIP MERLIER 03"

then when i save the information i do

replace t_gem.vtnr with substr(val(thisformset....,cb_vert(combobox),32,3)) : it means that the number of the account manager begins at position 32 and 3 long.
so the save is no problem only the lookup

wfg,

filip
 
again and again: Even if a file name can contain spaces, an alias name can't.

Seeing is believing so take a look at the datasession after you opened your table, select the workarea and ? ALIAS().

Bye, Olaf.
 
Hello Olaf,

The file name is named tmp_gvert dus contains no spaces
Only the string can contain spaces


wfg,


Filip
 
could someone else perhaps tell him, that an alias or cursor name cannot contain a space?
 
Hello Olaf,

now it works file, i forgot to initiliase the combobox in the init of the form or formset

sorry to put you into this kind of trouble

wfg,

filip

 
Fluppe689,

Upon Olaf's request:

Code:
Er mag geen spatie in de naam van een cursor of alias() zitten.
Capiche?

regards,

Jockey(2)
 
Dag Jockey2,

Er zit ook geen naam in de naam van de cursor de cursor noemt tmp_gvert alleen de rowsource is een string van 2 velden uit deze cursor file.

Ik had hem alleen niet geïnitialiseerd in de init of load van de form.

wfg,

Filip^
 
Filip,

Filip said:
i forgot to initiliase the combobox in the init of the form or formset

You're contradictiing yourself, you said you have initialised the combobox as follows:

I have done this already hundred's of times.
My combobox is set to dropdownlist.
My rowsource= tmp_gvert.vtnaam+ " " + str(tmp_gvert.vtnr,3,0)
My rowsourcetype = alias

And since then I was referring to that space in the rowsource, which is impossible as rowsourcetype alias. An alias can't have a space. I wasn't getting this over to you.

That is where your error is or was. Now that you changed your combobox initialisation everything works fine. Ok. You could have had that earlier, I pointed this out all the time.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top