Hi,
when I understand you correctly, you have a secondary datasource containing
the table with the equipment data, which has at least two columns: Possibly
an id, a name value and a description. You have bound the equipment (id,
name) to content the drop-down box. You have bound the selection of the
drop-down to a field in your primary datasource. Now you want the
description to to be displayed in the textbox when the selection changes.
So you basically have to bind the textbox the to the equipment description
and filter it by id, where the id matches the selected equipment.
Hope this helps,
Henning Krause [MVP - Exchange]
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/software/mistaya.aspx)
> Sorry to bother you again but it doesn't work,
> can you please, expalin the procedure, how should I bound the text box
[quoted text clipped - 50 lines]
>> >
>> > Jhon S.
Jeffshex - 09 Jun 2005 14:46 GMT
Will this pose a problem in repeating sections? I've got mine to sort and
autofill a text box, but it is quirky and seems that it grabs info every now
and then from the previous section.
> Hi,
>
[quoted text clipped - 69 lines]
> >> >
> >> > Jhon S.
Jeffshex - 09 Jun 2005 17:15 GMT
I have the textbox autopopulated by the selection on the ProjectNumber.
<<Rule:fill the field ProjectDescription with the database's
ProjectDescription FILTERED when MAIN FORM's ProjectNumber = DATABASE's
ProjectNumber.>>
Each repeating section wants to occaisonally grab the same textbox info as
the first section, (only some of the times though as weird as it does sound,
but it only happens when the ProjectNumbers are kind of close).
It's really weird and I can't figure it out.
> Will this pose a problem in repeating sections? I've got mine to sort and
> autofill a text box, but it is quirky and seems that it grabs info every now
[quoted text clipped - 73 lines]
> > >> >
> > >> > Jhon S.
Jhon S. - 09 Jun 2005 17:01 GMT
Yeah you understand it perfectly, thanks,
like you said, I have a primary datasource (main table) that stores all the
data and a secondary datasource containing the table with the equipment
data, which has 3 columns:
An id, an equipment_description and an equipment_area . I have bound the
equipment id to content the drop-down box. I have bound the selection of the
drop-down to a field in the primary datasource.
Now I want the description of the equipment to to be displayed in the
textbox when the selection changes.
But I get lost in these step I hope you can help me:
" So you basically have to bind the textbox the to the equipment description
and filter it by id, where the id matches the selected equipment."
bind is the same that bound, how did i do it ?
I tried and seams to work the first time, but it get stack in the first
selection a I'm using this relation in Default Value Fx :
@Area_Equipo[@Cod_Equipo = @Cod_Equipo]
in Xpath :
xdXDocument:GetDOM("Equipos")/dfs:myFields/dfs:dataFields/d:Equipos/@Area_Equipo[../@Cod_Equipo = ../@Cod_Equipo]
Any help would be much appreciated, Thanks,
Jhon S.
Henning Krause [MVP - Exhange] - 09 Jun 2005 20:24 GMT
Well, your XPath expression can not work the way it is,
xdXDocument:GetDOM("Equipos")/dfs:myFields/dfs:dataFields/d:Equipos/@Area_Equipo[../@Cod_Equipo
= ../@Cod_Equipo]
since [../@Cod_Equipo = ../@Cod_Equipo] will always evaluate to true. But I
stepped on the same error while testing....
With repeating values, it gets a little trickier.. :-)
It turns out that you should not rely on the command builder from Infopath
when it get to this kind of queries.
Try this expression:
xdXDocument:GetDOM("Equipos")/dfs:myFields/dfs:dataFields/d:Equipos[@Cod_Equipo
= current()]/@Area_Equipo
Note that current() gets you the node you are currently on. In this case,
the field that you have bound your drop-down box to. Now you set the value
of the textbox to the above query.
Greetings,
Henning Krause [MVP - Exchange]
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/software/mistaya.aspx)
> Yeah you understand it perfectly, thanks,
> like you said, I have a primary datasource (main table) that stores all
[quoted text clipped - 24 lines]
> Any help would be much appreciated, Thanks,
> Jhon S.