I am trying to create a grid to work something like this:

The grid would have 2 columns. The first column is always a textbox that
contains the property name. The second
column will allow the user to enter whatever value they wish for each
property. I want to swap out the control for this second column
from a textbox to a checkbox. Some of the properties are Yes/No and some
are just a character field.

Has anyone been able to do this? and if so, how?


Thanks
Dan

Re: Grids - DynamicCurrentControl by Jack

Jack
Fri Sep 28 15:17:43 PDT 2007

On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <spam@microsoft.com>
wrote:

>I am trying to create a grid to work something like this:
>
>The grid would have 2 columns. The first column is always a textbox that
>contains the property name. The second
>column will allow the user to enter whatever value they wish for each
>property. I want to swap out the control for this second column
>from a textbox to a checkbox. Some of the properties are Yes/No and some
>are just a character field.
>
>Has anyone been able to do this? and if so, how?

Add a checkbox control to the second column. In the designer, with
the grid being edited drop a checkbox onto column 2.

Set the second column's DynamicCurrentControl to a text string
containing an expression that selects the proper control.

For example, if the grid's rowsource cursor has a field 'controltype'
whose value is 0 for rows that should have a textbox and 1 for rows
that should have a checkbox, and the textbox in the column is named
text1 and the checkbox is named checkbox1:

Thisform.Grid.Column2.DynamicCurrentControl =
"IIF(controltype==0,"text1","checkbox1")"

If you have a complex expression it is usually better to create a form
method that does the calculation and returns the text string
containing the expression and then:

Thisform.Grid.Column2.DynamicCurrentControl =
"Thisform.GetCol2CurrentControl()"

Re: Grids - DynamicCurrentControl by Dan

Dan
Mon Oct 01 07:47:04 PDT 2007

I am getting the same problem I was having... Data Type mismatch.

Any idea what I am doing differently?

Created a form, added a grid. Added the checkbox control to second column.
In the code, I create a cursor with 3 fields
Create cursor temp1 ;
(cName c(30), cValue c(30), ControlType n(1))

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 2

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

thisform.Grid1.recordsourcetype = 1
thisform.Grid1.recordsource = "Temp1"
thisform.Grid1.column1.controlsource = "Temp1.cName"
thisform.Grid1.column2.controlsource = "Temp1.cValue"

thisform.Grid1.column2.DynamicCurrentControl = "iif(Temp1.ControlType =
1,'Text1','Check1')"

Thanks
Dan














"Jack Jackson" <jacknospam@pebbleridge.com> wrote in message
news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com...
> On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <spam@microsoft.com>
> wrote:
>
>>I am trying to create a grid to work something like this:
>>
>>The grid would have 2 columns. The first column is always a textbox that
>>contains the property name. The second
>>column will allow the user to enter whatever value they wish for each
>>property. I want to swap out the control for this second column
>>from a textbox to a checkbox. Some of the properties are Yes/No and
>>some
>>are just a character field.
>>
>>Has anyone been able to do this? and if so, how?
>
> Add a checkbox control to the second column. In the designer, with
> the grid being edited drop a checkbox onto column 2.
>
> Set the second column's DynamicCurrentControl to a text string
> containing an expression that selects the proper control.
>
> For example, if the grid's rowsource cursor has a field 'controltype'
> whose value is 0 for rows that should have a textbox and 1 for rows
> that should have a checkbox, and the textbox in the column is named
> text1 and the checkbox is named checkbox1:
>
> Thisform.Grid.Column2.DynamicCurrentControl =
> "IIF(controltype==0,"text1","checkbox1")"
>
> If you have a complex expression it is usually better to create a form
> method that does the calculation and returns the text string
> containing the expression and then:
>
> Thisform.Grid.Column2.DynamicCurrentControl =
> "Thisform.GetCol2CurrentControl()"



Re: Grids - DynamicCurrentControl by Rush

Rush
Mon Oct 01 08:50:04 PDT 2007

This is a multi-part message in MIME format.
--------------010402080907000903080206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

A checkbox can have either numeric or logical values - not text. What
are your expected values?

- Rush

Dan Tallent wrote:
> I am getting the same problem I was having... Data Type mismatch.
>
> Any idea what I am doing differently?
>
> Created a form, added a grid. Added the checkbox control to second column.
> In the code, I create a cursor with 3 fields
> Create cursor temp1 ;
> (cName c(30), cValue c(30), ControlType n(1))
>
> select temp1
> append blank
> replace temp1.cName with "Test Line 1"
> replace temp1.cValue with ""
> replace temp1.cControlType with 1
>
> select temp1
> append blank
> replace temp1.cName with "Test Line 1"
> replace temp1.cValue with ""
> replace temp1.cControlType with 2
>
> select temp1
> append blank
> replace temp1.cName with "Test Line 1"
> replace temp1.cValue with ""
> replace temp1.cControlType with 1
>
> thisform.Grid1.recordsourcetype = 1
> thisform.Grid1.recordsource = "Temp1"
> thisform.Grid1.column1.controlsource = "Temp1.cName"
> thisform.Grid1.column2.controlsource = "Temp1.cValue"
>
> thisform.Grid1.column2.DynamicCurrentControl = "iif(Temp1.ControlType =
> 1,'Text1','Check1')"
>
> Thanks
> Dan
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "Jack Jackson" <jacknospam@pebbleridge.com> wrote in message
> news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com...
>
>> On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <spam@microsoft.com>
>> wrote:
>>
>>
>>> I am trying to create a grid to work something like this:
>>>
>>> The grid would have 2 columns. The first column is always a textbox that
>>> contains the property name. The second
>>> column will allow the user to enter whatever value they wish for each
>>> property. I want to swap out the control for this second column
>>>
>> >from a textbox to a checkbox. Some of the properties are Yes/No and
>>
>>> some
>>> are just a character field.
>>>
>>> Has anyone been able to do this? and if so, how?
>>>
>> Add a checkbox control to the second column. In the designer, with
>> the grid being edited drop a checkbox onto column 2.
>>
>> Set the second column's DynamicCurrentControl to a text string
>> containing an expression that selects the proper control.
>>
>> For example, if the grid's rowsource cursor has a field 'controltype'
>> whose value is 0 for rows that should have a textbox and 1 for rows
>> that should have a checkbox, and the textbox in the column is named
>> text1 and the checkbox is named checkbox1:
>>
>> Thisform.Grid.Column2.DynamicCurrentControl =
>> "IIF(controltype==0,"text1","checkbox1")"
>>
>> If you have a complex expression it is usually better to create a form
>> method that does the calculation and returns the text string
>> containing the expression and then:
>>
>> Thisform.Grid.Column2.DynamicCurrentControl =
>> "Thisform.GetCol2CurrentControl()"
>>
>
>
>


--------------010402080907000903080206
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
A checkbox can have either numeric or logical values - not text.&nbsp; What
are your expected values?<br>
<br>
&nbsp;- Rush<br>
<br>
Dan Tallent wrote:
<blockquote cite="mid:Oq09vnDBIHA.4568@TK2MSFTNGP02.phx.gbl" type="cite">
<pre wrap="">I am getting the same problem I was having... Data Type mismatch.

Any idea what I am doing differently?

Created a form, added a grid. Added the checkbox control to second column.
In the code, I create a cursor with 3 fields
Create cursor temp1 ;
(cName c(30), cValue c(30), ControlType n(1))

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 2

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

thisform.Grid1.recordsourcetype = 1
thisform.Grid1.recordsource = "Temp1"
thisform.Grid1.column1.controlsource = "Temp1.cName"
thisform.Grid1.column2.controlsource = "Temp1.cValue"

thisform.Grid1.column2.DynamicCurrentControl = "iif(Temp1.ControlType =
1,'Text1','Check1')"

Thanks
Dan














"Jack Jackson" <a class="moz-txt-link-rfc2396E" href="mailto:jacknospam@pebbleridge.com">&lt;jacknospam@pebbleridge.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com">news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com</a>...
</pre>
<blockquote type="cite">
<pre wrap="">On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <a class="moz-txt-link-rfc2396E" href="mailto:spam@microsoft.com">&lt;spam@microsoft.com&gt;</a>
wrote:

</pre>
<blockquote type="cite">
<pre wrap="">I am trying to create a grid to work something like this:

The grid would have 2 columns. The first column is always a textbox that
contains the property name. The second
column will allow the user to enter whatever value they wish for each
property. I want to swap out the control for this second column
</pre>
</blockquote>
<pre wrap="">&gt;from a textbox to a checkbox. Some of the properties are Yes/No and
</pre>
<blockquote type="cite">
<pre wrap="">some
are just a character field.

Has anyone been able to do this? and if so, how?
</pre>
</blockquote>
<pre wrap="">Add a checkbox control to the second column. In the designer, with
the grid being edited drop a checkbox onto column 2.

Set the second column's DynamicCurrentControl to a text string
containing an expression that selects the proper control.

For example, if the grid's rowsource cursor has a field 'controltype'
whose value is 0 for rows that should have a textbox and 1 for rows
that should have a checkbox, and the textbox in the column is named
text1 and the checkbox is named checkbox1:

Thisform.Grid.Column2.DynamicCurrentControl =
"IIF(controltype==0,"text1","checkbox1")"

If you have a complex expression it is usually better to create a form
method that does the calculation and returns the text string
containing the expression and then:

Thisform.Grid.Column2.DynamicCurrentControl =
"Thisform.GetCol2CurrentControl()"
</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------010402080907000903080206--

Re: Grids - DynamicCurrentControl by Dan

Dan
Mon Oct 01 14:14:19 PDT 2007

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C8044E.809815B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Exactly. I was looking for some method that would let me link the =
checkbox to a separate field in the table.

At this point, I have a combo box swapping in where I would of used a =
checkbox. The user can pick between three
values: blank, checked, unchecked.

I was just hoping that someone found a way to have some rows using a =
checkbox so it would be easier for my users.

Thanks
dan


"Rush Strong" <rpstrong@gmail.com> wrote in message =
news:MG8Mi.3386$Hb2.3190@trndny07...
A checkbox can have either numeric or logical values - not text. What =
are your expected values?

- Rush

Dan Tallent wrote:=20
I am getting the same problem I was having... Data Type mismatch.

Any idea what I am doing differently?

Created a form, added a grid. Added the checkbox control to second =
column.
In the code, I create a cursor with 3 fields
Create cursor temp1 ;
(cName c(30), cValue c(30), ControlType n(1))

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 2

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

thisform.Grid1.recordsourcetype =3D 1
thisform.Grid1.recordsource =3D "Temp1"
thisform.Grid1.column1.controlsource =3D "Temp1.cName"
thisform.Grid1.column2.controlsource =3D "Temp1.cValue"

thisform.Grid1.column2.DynamicCurrentControl =3D "iif(Temp1.ControlType =
=3D=20
1,'Text1','Check1')"

Thanks
Dan














"Jack Jackson" <jacknospam@pebbleridge.com> wrote in message=20
news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com...
On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <spam@microsoft.com>
wrote:

I am trying to create a grid to work something like this:

The grid would have 2 columns. The first column is always a textbox =
that
contains the property name. The second
column will allow the user to enter whatever value they wish for each
property. I want to swap out the control for this second column
>from a textbox to a checkbox. Some of the properties are =
Yes/No and=20
some
are just a character field.

Has anyone been able to do this? and if so, how?
Add a checkbox control to the second column. In the designer, =
with
the grid being edited drop a checkbox onto column 2.

Set the second column's DynamicCurrentControl to a text string
containing an expression that selects the proper control.

For example, if the grid's rowsource cursor has a field 'controltype'
whose value is 0 for rows that should have a textbox and 1 for rows
that should have a checkbox, and the textbox in the column is named
text1 and the checkbox is named checkbox1:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"IIF(controltype=3D=3D0,"text1","checkbox1")"

If you have a complex expression it is usually better to create a form
method that does the calculation and returns the text string
containing the expression and then:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"Thisform.GetCol2CurrentControl()"=20
=20

=20

------=_NextPart_000_000A_01C8044E.809815B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Exactly.&nbsp; I was looking for some =
method that=20
would let me link the checkbox to a separate field in the =
table.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>At this point, I have a combo box =
swapping in where=20
I would of used a checkbox.&nbsp;&nbsp; The user can pick between=20
three</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>values: blank, checked, =
unchecked.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I was just hoping that someone found a =
way to have=20
some rows using a checkbox so it would be easier for my =
users.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dan</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Rush Strong" &lt;<A=20
href=3D"mailto:rpstrong@gmail.com">rpstrong@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:MG8Mi.3386$Hb2.3190@trndny07">news:MG8Mi.3386$Hb2.3190@trndn=
y07</A>...</DIV>A=20
checkbox can have either numeric or logical values - not text.&nbsp; =
What are=20
your expected values?<BR><BR>&nbsp;- Rush<BR><BR>Dan Tallent wrote:=20
<BLOCKQUOTE cite=3Dmid:Oq09vnDBIHA.4568@TK2MSFTNGP02.phx.gbl =
type=3D"cite"><PRE wrap=3D"">I am getting the same problem I was =
having... Data Type mismatch.

Any idea what I am doing differently?

Created a form, added a grid. Added the checkbox control to second =
column.
In the code, I create a cursor with 3 fields
Create cursor temp1 ;
(cName c(30), cValue c(30), ControlType n(1))

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 2

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

thisform.Grid1.recordsourcetype =3D 1
thisform.Grid1.recordsource =3D "Temp1"
thisform.Grid1.column1.controlsource =3D "Temp1.cName"
thisform.Grid1.column2.controlsource =3D "Temp1.cValue"

thisform.Grid1.column2.DynamicCurrentControl =3D "iif(Temp1.ControlType =
=3D=20
1,'Text1','Check1')"

Thanks
Dan














"Jack Jackson" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:jacknospam@pebbleridge.com">&lt;jacknospam@pebbleridge.com=
&gt;</A> wrote in message=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com">news:rsuqf3hrt9l=
g33n66e2v6u5u271jkkjigr@4ax.com</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">On Fri, 28 Sep 2007 =
14:34:04 -0400, "Dan Tallent" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:spam@microsoft.com">&lt;spam@microsoft.com&gt;</A>
wrote:

</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">I am trying to create a =
grid to work something like this:

The grid would have 2 columns. The first column is always a textbox =
that
contains the property name. The second
column will allow the user to enter whatever value they wish for each
property. I want to swap out the control for this second column
</PRE></BLOCKQUOTE><PRE wrap=3D"">&gt;from a textbox to a =
checkbox. Some of the properties are Yes/No and=20
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">some
are just a character field.

Has anyone been able to do this? and if so, how?
</PRE></BLOCKQUOTE><PRE wrap=3D"">Add a checkbox control to the =
second column. In the designer, with
the grid being edited drop a checkbox onto column 2.

Set the second column's DynamicCurrentControl to a text string
containing an expression that selects the proper control.

For example, if the grid's rowsource cursor has a field 'controltype'
whose value is 0 for rows that should have a textbox and 1 for rows
that should have a checkbox, and the textbox in the column is named
text1 and the checkbox is named checkbox1:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"IIF(controltype=3D=3D0,"text1","checkbox1")"

If you have a complex expression it is usually better to create a form
method that does the calculation and returns the text string
containing the expression and then:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"Thisform.GetCol2CurrentControl()"=20
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000A_01C8044E.809815B0--


Re: Grids - DynamicCurrentControl by Rush

Rush
Mon Oct 01 16:28:54 PDT 2007

This is a multi-part message in MIME format.
--------------050802070203010209000206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Well, now we're getting somewhere! Set the .controlsource property for
the textbox and checkbox to the desired fields, and, in the column, set:

.controlsource to (none)
.sparse to .F.
.bound to .F.

That should do it for you.

- Rush

Dan Tallent wrote:
> Exactly. I was looking for some method that would let me link the
> checkbox to a separate field in the table.
>
> At this point, I have a combo box swapping in where I would of used a
> checkbox. The user can pick between three
> values: blank, checked, unchecked.
>
> I was just hoping that someone found a way to have some rows using a
> checkbox so it would be easier for my users.
>
> Thanks
> dan
>
>
>
> "Rush Strong" <rpstrong@gmail.com <mailto:rpstrong@gmail.com>>
> wrote in message news:MG8Mi.3386$Hb2.3190@trndny07...
> A checkbox can have either numeric or logical values - not text.
> What are your expected values?
>
> - Rush
>
> Dan Tallent wrote:
>> I am getting the same problem I was having... Data Type mismatch.
>>
>> Any idea what I am doing differently?
>>
>> Created a form, added a grid. Added the checkbox control to second column.
>> In the code, I create a cursor with 3 fields
>> Create cursor temp1 ;
>> (cName c(30), cValue c(30), ControlType n(1))
>>
>> select temp1
>> append blank
>> replace temp1.cName with "Test Line 1"
>> replace temp1.cValue with ""
>> replace temp1.cControlType with 1
>>
>> select temp1
>> append blank
>> replace temp1.cName with "Test Line 1"
>> replace temp1.cValue with ""
>> replace temp1.cControlType with 2
>>
>> select temp1
>> append blank
>> replace temp1.cName with "Test Line 1"
>> replace temp1.cValue with ""
>> replace temp1.cControlType with 1
>>
>> thisform.Grid1.recordsourcetype = 1
>> thisform.Grid1.recordsource = "Temp1"
>> thisform.Grid1.column1.controlsource = "Temp1.cName"
>> thisform.Grid1.column2.controlsource = "Temp1.cValue"
>>
>> thisform.Grid1.column2.DynamicCurrentControl = "iif(Temp1.ControlType =
>> 1,'Text1','Check1')"
>>
>> Thanks
>> Dan
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> "Jack Jackson" <jacknospam@pebbleridge.com> wrote in message
>> news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com...
>>
>>> On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <spam@microsoft.com>
>>> wrote:
>>>
>>>
>>>> I am trying to create a grid to work something like this:
>>>>
>>>> The grid would have 2 columns. The first column is always a textbox that
>>>> contains the property name. The second
>>>> column will allow the user to enter whatever value they wish for each
>>>> property. I want to swap out the control for this second column
>>>>
>>> >from a textbox to a checkbox. Some of the properties are Yes/No and
>>>
>>>> some
>>>> are just a character field.
>>>>
>>>> Has anyone been able to do this? and if so, how?
>>>>
>>> Add a checkbox control to the second column. In the designer, with
>>> the grid being edited drop a checkbox onto column 2.
>>>
>>> Set the second column's DynamicCurrentControl to a text string
>>> containing an expression that selects the proper control.
>>>
>>> For example, if the grid's rowsource cursor has a field 'controltype'
>>> whose value is 0 for rows that should have a textbox and 1 for rows
>>> that should have a checkbox, and the textbox in the column is named
>>> text1 and the checkbox is named checkbox1:
>>>
>>> Thisform.Grid.Column2.DynamicCurrentControl =
>>> "IIF(controltype==0,"text1","checkbox1")"
>>>
>>> If you have a complex expression it is usually better to create a form
>>> method that does the calculation and returns the text string
>>> containing the expression and then:
>>>
>>> Thisform.Grid.Column2.DynamicCurrentControl =
>>> "Thisform.GetCol2CurrentControl()"
>>>
>>
>>
>>
>


--------------050802070203010209000206
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Well, now we're getting somewhere!&nbsp; Set the .controlsource property for
the textbox and checkbox to the desired fields, and, in the column, set:<br>
<br>
&nbsp;&nbsp;&nbsp; .controlsource to (none)<br>
&nbsp;&nbsp;&nbsp; .sparse to .F.<br>
&nbsp;&nbsp;&nbsp; .bound to .F.<br>
<br>
That should do it for you.<br>
<br>
&nbsp;- Rush<br>
<br>
Dan Tallent wrote:
<blockquote cite="mid:%23LxxGAHBIHA.4612@TK2MSFTNGP03.phx.gbl"
type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.6000.16525" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Exactly.&nbsp; I was looking for some
method that would let me link the checkbox to a separate field in the
table.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">At this point, I have a combo box
swapping in where I would of used a checkbox.&nbsp;&nbsp; The user can pick
between three</font></div>
<div><font face="Arial" size="2">values: blank, checked, unchecked.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">I was just hoping that someone found
a way to have some rows using a checkbox so it would be easier for my
users.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Thanks</font></div>
<div><font face="Arial" size="2">dan</font></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Rush Strong" &lt;<a moz-do-not-send="true"
href="mailto:rpstrong@gmail.com">rpstrong@gmail.com</a>&gt; wrote in
message <a moz-do-not-send="true"
href="news:MG8Mi.3386$Hb2.3190@trndny07">news:MG8Mi.3386$Hb2.3190@trndny07</a>...</div>
A checkbox can have either numeric or logical values - not text.&nbsp; What
are your expected values?<br>
<br>
&nbsp;- Rush<br>
<br>
Dan Tallent wrote:
<blockquote cite="mid:Oq09vnDBIHA.4568@TK2MSFTNGP02.phx.gbl"
type="cite">
<pre wrap="">I am getting the same problem I was having... Data Type mismatch.

Any idea what I am doing differently?

Created a form, added a grid. Added the checkbox control to second column.
In the code, I create a cursor with 3 fields
Create cursor temp1 ;
(cName c(30), cValue c(30), ControlType n(1))

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 2

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

thisform.Grid1.recordsourcetype = 1
thisform.Grid1.recordsource = "Temp1"
thisform.Grid1.column1.controlsource = "Temp1.cName"
thisform.Grid1.column2.controlsource = "Temp1.cValue"

thisform.Grid1.column2.DynamicCurrentControl = "iif(Temp1.ControlType =
1,'Text1','Check1')"

Thanks
Dan














"Jack Jackson" <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:jacknospam@pebbleridge.com">&lt;jacknospam@pebbleridge.com&gt;</a> wrote in message
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com">news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com</a>...
</pre>
<blockquote type="cite">
<pre wrap="">On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <a
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:spam@microsoft.com">&lt;spam@microsoft.com&gt;</a>
wrote:

</pre>
<blockquote type="cite">
<pre wrap="">I am trying to create a grid to work something like this:

The grid would have 2 columns. The first column is always a textbox that
contains the property name. The second
column will allow the user to enter whatever value they wish for each
property. I want to swap out the control for this second column
</pre>
</blockquote>
<pre wrap="">&gt;from a textbox to a checkbox. Some of the properties are Yes/No and
</pre>
<blockquote type="cite">
<pre wrap="">some
are just a character field.

Has anyone been able to do this? and if so, how?
</pre>
</blockquote>
<pre wrap="">Add a checkbox control to the second column. In the designer, with
the grid being edited drop a checkbox onto column 2.

Set the second column's DynamicCurrentControl to a text string
containing an expression that selects the proper control.

For example, if the grid's rowsource cursor has a field 'controltype'
whose value is 0 for rows that should have a textbox and 1 for rows
that should have a checkbox, and the textbox in the column is named
text1 and the checkbox is named checkbox1:

Thisform.Grid.Column2.DynamicCurrentControl =
"IIF(controltype==0,"text1","checkbox1")"

If you have a complex expression it is usually better to create a form
method that does the calculation and returns the text string
containing the expression and then:

Thisform.Grid.Column2.DynamicCurrentControl =
"Thisform.GetCol2CurrentControl()"
</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</body>
</html>

--------------050802070203010209000206--

Re: Grids - DynamicCurrentControl by Dan

Dan
Tue Oct 02 06:52:29 PDT 2007

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C804D9.F215FA00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks
Dan

"Rush Strong" <rpstrong@gmail.com> wrote in message =
news:WofMi.1217$R%1.290@trndny06...
Well, now we're getting somewhere! Set the .controlsource property =
for the textbox and checkbox to the desired fields, and, in the column, =
set:

.controlsource to (none)
.sparse to .F.
.bound to .F.

That should do it for you.

- Rush

Dan Tallent wrote:=20
Exactly. I was looking for some method that would let me link the =
checkbox to a separate field in the table.

At this point, I have a combo box swapping in where I would of used =
a checkbox. The user can pick between three
values: blank, checked, unchecked.

I was just hoping that someone found a way to have some rows using a =
checkbox so it would be easier for my users.

Thanks
dan


"Rush Strong" <rpstrong@gmail.com> wrote in message =
news:MG8Mi.3386$Hb2.3190@trndny07...
A checkbox can have either numeric or logical values - not text. =
What are your expected values?

- Rush

Dan Tallent wrote:=20
I am getting the same problem I was having... Data Type mismatch.

Any idea what I am doing differently?

Created a form, added a grid. Added the checkbox control to second =
column.
In the code, I create a cursor with 3 fields
Create cursor temp1 ;
(cName c(30), cValue c(30), ControlType n(1))

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 2

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

thisform.Grid1.recordsourcetype =3D 1
thisform.Grid1.recordsource =3D "Temp1"
thisform.Grid1.column1.controlsource =3D "Temp1.cName"
thisform.Grid1.column2.controlsource =3D "Temp1.cValue"

thisform.Grid1.column2.DynamicCurrentControl =3D "iif(Temp1.ControlType =
=3D=20
1,'Text1','Check1')"

Thanks
Dan














"Jack Jackson" <jacknospam@pebbleridge.com> wrote in message=20
news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com...
On Fri, 28 Sep 2007 14:34:04 -0400, "Dan Tallent" <spam@microsoft.com>
wrote:

I am trying to create a grid to work something like this:

The grid would have 2 columns. The first column is always a textbox =
that
contains the property name. The second
column will allow the user to enter whatever value they wish for each
property. I want to swap out the control for this second column
>from a textbox to a checkbox. Some of the properties are =
Yes/No and=20
some
are just a character field.

Has anyone been able to do this? and if so, how?
Add a checkbox control to the second column. In the designer, =
with
the grid being edited drop a checkbox onto column 2.

Set the second column's DynamicCurrentControl to a text string
containing an expression that selects the proper control.

For example, if the grid's rowsource cursor has a field 'controltype'
whose value is 0 for rows that should have a textbox and 1 for rows
that should have a checkbox, and the textbox in the column is named
text1 and the checkbox is named checkbox1:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"IIF(controltype=3D=3D0,"text1","checkbox1")"

If you have a complex expression it is usually better to create a form
method that does the calculation and returns the text string
containing the expression and then:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"Thisform.GetCol2CurrentControl()"=20
=20

=20



------=_NextPart_000_000A_01C804D9.F215FA00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Dan</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Rush Strong" &lt;<A=20
href=3D"mailto:rpstrong@gmail.com">rpstrong@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:WofMi.1217$R%1.290@trndny06">news:WofMi.1217$R%1.290@trndny0=
6</A>...</DIV>Well,=20
now we're getting somewhere!&nbsp; Set the .controlsource property for =
the=20
textbox and checkbox to the desired fields, and, in the column,=20
set:<BR><BR>&nbsp;&nbsp;&nbsp; .controlsource to =
(none)<BR>&nbsp;&nbsp;&nbsp;=20
.sparse to .F.<BR>&nbsp;&nbsp;&nbsp; .bound to .F.<BR><BR>That should =
do it=20
for you.<BR><BR>&nbsp;- Rush<BR><BR>Dan Tallent wrote:=20
<BLOCKQUOTE cite=3Dmid:%23LxxGAHBIHA.4612@TK2MSFTNGP03.phx.gbl =
type=3D"cite">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Exactly.&nbsp; I was looking for =
some method=20
that would let me link the checkbox to a separate field in the=20
table.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>At this point, I have a combo box =
swapping in=20
where I would of used a checkbox.&nbsp;&nbsp; The user can pick =
between=20
three</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>values: blank, checked, =
unchecked.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I was just hoping that someone =
found a way to=20
have some rows using a checkbox so it would be easier for my=20
users.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dan</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Rush Strong" &lt;<A href=3D"mailto:rpstrong@gmail.com"=20
moz-do-not-send=3D"true">rpstrong@gmail.com</A>&gt; wrote in =
message <A=20
href=3D"news:MG8Mi.3386$Hb2.3190@trndny07"=20
=
moz-do-not-send=3D"true">news:MG8Mi.3386$Hb2.3190@trndny07</A>...</DIV>A =

checkbox can have either numeric or logical values - not =
text.&nbsp; What=20
are your expected values?<BR><BR>&nbsp;- Rush<BR><BR>Dan Tallent =
wrote:=20
<BLOCKQUOTE cite=3Dmid:Oq09vnDBIHA.4568@TK2MSFTNGP02.phx.gbl =
type=3D"cite"><PRE wrap=3D"">I am getting the same problem I was =
having... Data Type mismatch.

Any idea what I am doing differently?

Created a form, added a grid. Added the checkbox control to second =
column.
In the code, I create a cursor with 3 fields
Create cursor temp1 ;
(cName c(30), cValue c(30), ControlType n(1))

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 2

select temp1
append blank
replace temp1.cName with "Test Line 1"
replace temp1.cValue with ""
replace temp1.cControlType with 1

thisform.Grid1.recordsourcetype =3D 1
thisform.Grid1.recordsource =3D "Temp1"
thisform.Grid1.column1.controlsource =3D "Temp1.cName"
thisform.Grid1.column2.controlsource =3D "Temp1.cValue"

thisform.Grid1.column2.DynamicCurrentControl =3D "iif(Temp1.ControlType =
=3D=20
1,'Text1','Check1')"

Thanks
Dan














"Jack Jackson" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:jacknospam@pebbleridge.com" =
moz-do-not-send=3D"true">&lt;jacknospam@pebbleridge.com&gt;</A> wrote in =
message=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com" =
moz-do-not-send=3D"true">news:rsuqf3hrt9lg33n66e2v6u5u271jkkjigr@4ax.com<=
/A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">On Fri, 28 Sep 2007 =
14:34:04 -0400, "Dan Tallent" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:spam@microsoft.com" =
moz-do-not-send=3D"true">&lt;spam@microsoft.com&gt;</A>
wrote:

</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">I am trying to create =
a grid to work something like this:

The grid would have 2 columns. The first column is always a textbox =
that
contains the property name. The second
column will allow the user to enter whatever value they wish for each
property. I want to swap out the control for this second column
</PRE></BLOCKQUOTE><PRE wrap=3D"">&gt;from a textbox to a =
checkbox. Some of the properties are Yes/No and=20
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">some
are just a character field.

Has anyone been able to do this? and if so, how?
</PRE></BLOCKQUOTE><PRE wrap=3D"">Add a checkbox control to the =
second column. In the designer, with
the grid being edited drop a checkbox onto column 2.

Set the second column's DynamicCurrentControl to a text string
containing an expression that selects the proper control.

For example, if the grid's rowsource cursor has a field 'controltype'
whose value is 0 for rows that should have a textbox and 1 for rows
that should have a checkbox, and the textbox in the column is named
text1 and the checkbox is named checkbox1:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"IIF(controltype=3D=3D0,"text1","checkbox1")"

If you have a complex expression it is usually better to create a form
method that does the calculation and returns the text string
containing the expression and then:

Thisform.Grid.Column2.DynamicCurrentControl =3D
"Thisform.GetCol2CurrentControl()"=20
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY>=
</HTML>

------=_NextPart_000_000A_01C804D9.F215FA00--