Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Multi-select rows in a subform


Message #1 by "John K. King" <johnking@o...> on Thu, 25 Apr 2002 03:52:45
Hi:

I'm trying to take a subform, using Datasheet view, select multiple row 
and manipulate the selected rows. So far, I can't even tell if more than 
one row in the subform is selected.

To be specific, I want to select similar rows and update an ID field in 
those rows with the same value so that all of the selected values will be 
treated as aliases.

In the main form I select the target value (for instance, United States of 
America) and its associated ID number.

The subform may have three rows, with the following values:

United States
US
US of A

So, I want to select all three rows and click on a command button and 
update a value in each of those rows to the value supplied by the target 
value.

I can get to individual fields of the first selected row using 
Me.SubformName(0), Me.SubformName(1), ..., Me.SubformName(n),
but I haven't been able to identify 

a) how many rows are selected
b) which are selected beyond the first selected row.

Any suggestions are welcome and very much appreciated.

Thanks,
JK
Message #2 by "John Ruff" <papparuff@c...> on Thu, 25 Apr 2002 08:52:50 -0700
This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C1EC36.96446B60
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

John,

I suggest adding another field to the table where you want to update the
ID field.  The new field could be called Selected and it could be a
checkbox.  I would then add this checkbox as part of the recordsource of
the subform.  When you want to select a row in the subform, click on the
checkbox.  You can then run an update query or SQL statement to update
those records where the checkbox is true.  This same update query could
be used to set the checkbox back to false.



John Ruff - The Eternal Optimist :-) 
Always looking for Contract Opportunities 
  
9306 Farwest Dr SW 
Lakewood, WA 98498 
papparuff@c... 


-----Original Message-----
From: John K. King [mailto:johnking@o...]
Sent: Thursday, April 25, 2002 3:53 AM
To: Access
Subject: [access] Multi-select rows in a subform


Hi:

I'm trying to take a subform, using Datasheet view, select multiple row
and manipulate the selected rows. So far, I can't even tell if more than
one row in the subform is selected.

To be specific, I want to select similar rows and update an ID field in
those rows with the same value so that all of the selected values will
be
treated as aliases.

In the main form I select the target value (for instance, United States
of
America) and its associated ID number.

The subform may have three rows, with the following values:

United States
US
US of A

So, I want to select all three rows and click on a command button and
update a value in each of those rows to the value supplied by the target
value.

I can get to individual fields of the first selected row using
Me.SubformName(0), Me.SubformName(1), ..., Me.SubformName(n), but I
haven't been able to identify

a) how many rows are selected
b) which are selected beyond the first selected row.

Any suggestions are welcome and very much appreciated.

Thanks,
JK




Message #3 by "John K. King" <johnking@o...> on Thu, 25 Apr 2002 09:06:12 -0700
--=====================_166043938==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi John:

At 08:52 AM 4/25/2002, John Ruff wrote:



I suggest adding another field to the table where you want to update the
ID field.  The new field could be called Selected and it could be a
checkbox.  I would then add this checkbox as part of the recordsource of
the subform.  When you want to select a row in the subform, click on the
checkbox.  You can then run an update query or SQL statement to update
those records where the checkbox is true.  This same update query could
be used to set the checkbox back to false.



I understand, that makes sense. Thanks for the idea.
 
I wasn't yet considering alternative ways to handle this because I
thought that surely, if multiple rows on the subform datasheet can be
selected, they can be addressed and manipulated, much like list box
entries  (ItemsSelected, ItemData, etc).

Can I assume that there is no way to do what I wanted to do? If there
is, I certainly haven't found it.

Thanks for your time. I do appreciate it.

JK



Message #4 by "John K. King" <johnking@o...> on Thu, 25 Apr 2002 09:14:37 -0700
--=====================_166443583==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi John:

At 08:52 AM 4/25/2002, you wrote:



John,

I suggest adding another field to the table where you want to update the
ID field.  The new field could be called Selected and it could be a
checkbox.  I would then add this checkbox as part of the recordsource of
the subform.  When you want to select a row in the subform, click on the
checkbox.  You can then run an update query or SQL statement to update
those records where the checkbox is true.  This same update query could
be used to set the checkbox back to false.




I understand, that makes sense. Thanks for the idea.

I wasn't yet considering alternative ways to handle this because I
thought that surely, if multiple rows on the subform datasheet can be
selected, they can be addressed and manipulated, much like list box
entries (ItemsSelected, ItemData, etc).

Can I assume that there is no way to do what I wanted to do? If there
is, I certainly haven't found it.

Thanks for your time. I do appreciate it.

JK




Message #5 by "John Ruff" <papparuff@c...> on Thu, 25 Apr 2002 09:26:13 -0700
This is a multi-part message in MIME format.

------=_NextPart_000_0019_01C1EC3B.45A0B470
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

I personally don't know of a way, but there may be.  Hopefully someone
else may know and will pick up the thread.
 
 

John Ruff - The Eternal Optimist :-) 
Always looking for Contract Opportunities 
  
9306 Farwest Dr SW 
Lakewood, WA 98498 
papparuff@c... 

-----Original Message-----
From: John K. King [mailto:johnking@o...] 
Sent: Thursday, April 25, 2002 9:06 AM
To: Access
Subject: [access] RE: Multi-select rows in a subform


Hi John:

At 08:52 AM 4/25/2002, John Ruff wrote:



I suggest adding another field to the table where you want to update the
ID field.  The new field could be called Selected and it could be a
checkbox.  I would then add this checkbox as part of the recordsource of
the subform.  When you want to select a row in the subform, click on the
checkbox.  You can then run an update query or SQL statement to update
those records where the checkbox is true.  This same update query could
be used to set the checkbox back to false.



I understand, that makes sense. Thanks for the idea.
 
I wasn't yet considering alternative ways to handle this because I
thought that surely, if multiple rows on the subform datasheet can be
selected, they can be addressed and manipulated, much like list box
entries  (ItemsSelected, ItemData, etc).

Can I assume that there is no way to do what I wanted to do? If there
is, I certainly haven't found it.

Thanks for your time. I do appreciate it.

JK

--- 




  Return to Index