UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Subform checkbox on datasheet format needs to be independent    
 
   
petite39
post Nov 3 2008, 09:43 AM
Post #1

UtterAccess Ruler
Posts: 1,051



I have a subform that is in a datasheet format. I put an unbound checkbox on the subform and it looks great but I can't seem to check the box for an individual record....it checks them all. How do I get it to be independent?
Go to the top of the page
 
+
fkegley
post Nov 3 2008, 09:55 AM
Post #2

UtterAccess VIP
Posts: 23,583
From: Mississippi



This cannot be done. Appearances notwithstanding, the unbound controls on a datasheet share the same property settings. Therefore, checking one checks them all. If you open the form in design view, you will see that there is only one checkbox control on the form. That is repeated as many times as necessary to display the records contained in the subform.

You're going to have to come up with another way to do this.
Go to the top of the page
 
+
petite39
post Nov 3 2008, 10:04 AM
Post #3

UtterAccess Ruler
Posts: 1,051



Thanks, I thought so.
Go to the top of the page
 
+
petite39
post Nov 3 2008, 11:23 AM
Post #4

UtterAccess Ruler
Posts: 1,051



Ok, scrap the checkbox idea.

Can I highlight the record(s) in the datasheet on the subform and then click a button on the main form to only select the ones highlighted?
Go to the top of the page
 
+
fkegley
post Nov 3 2008, 02:55 PM
Post #5

UtterAccess VIP
Posts: 23,583
From: Mississippi



It is not that simple. My suggestion would be to switch to continuous forms view of the subform. Then alter the record source so that the primary key of each record is part of each row. I would hide it. Then, the user can just double-click the desirable rows. At each double-click you can put the Primary Key into a text box, joining it to the previous values with a suitable separator, say a ; (anything will do, as long as it cannot be mistaken for part of a data value). So for instance, if your PK is type AutoNumber, then the ; will do nicely. The user would then click a "go" button on the form.

In the Double-click event of one or more fields of the datasheet, you would need this:

Me.NameOfTextBox = Me.NameOfTextBox & Me.NameOfSubform!NameOfPrimaryKeyControl & ";"

Or you could put a list box on the main form. In the double-click event of one or more fields in the subform, add whatever fields you want to the row source of the list box. Its RowSourceType would need to be Value List for this to work.

Then whatever you want to do can be done using the contents of the list box or the text box.
Go to the top of the page
 
+
corinnewu
post Nov 18 2008, 02:46 PM
Post #6

New Member
Posts: 1



I am in a similar situation. I have a subform which I can double click the records and add the records to the textBoxes in my main form. My question is: can I highlight those records which has been clicked in the subform?

Thanks for the help!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th May 2013 - 03:46 AM