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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuous Form as a SubForm Problems

Status
Not open for further replies.

chew1920

Programmer
Jan 11, 2005
25
0
0
US
I have a Continuous form that I am using as a subform to display detail information. On that subform I have two check boxes, one that is dependent on the other, so I have written some code that changes the enabled status of the second checkbox. The problem is that it changes the display on all of the rows and not just the one row. I have also added code in the on change event that checkes the statuses for each row that is used and fixes it for all of the rows. Is there any way to fix this so that only the row that is being modified will have the check box enabled?

Thanks in advance for the help
 
Provided both check boxes are bound you may consider Conditional formatting.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I don't have a response to your question exactly but... I was browsing this site trying to find a thread with a solution to the type of problem you seem to have started to solve. I am trying to develope the same type of code that you appear to have figured out, that would make the changes to my subform, and enable the rows below. I haven't been able to figure out the code. Secondly, I have two layers of subforms and I haven't been successful in displaying a continuous form on the subsubform.

My thoughts would be conditional formatting as suggested by the last post as a solution to your problem.
 
I would assume that these controls are unbound, because if they were bound this should not be a problem. The reason that they all change, is that they are in fact just 1 control. Everything else is "paint on the screen"
So here is the solution I use. Actually, build a field called "blnSelected". Now this is a strange field, because it is only a place holder to allow me to populate some other table. So here is an example lets say you have People and a Chinese Menu. You have a main form with people and a subform showing the menu Choices. Based on a People table and a Menu table

tblPeople
personID
personName
other people fields

tblMenu
menuID
MenuItem
Cost
blnSelected

Now you have a join (junction) table that allows the many to many relationship

joinTblPeople_MenuChoices
FKpersonID
FKmenuID

Since "blnSelected" is bound I can change each records individual value. So a Person can make menu choices by clicking down the list. On the On Current event of the Main form I read from, and write to, the join table. So after I select some menu choices for a person, I read each selected Menu item and populate the join table with the Person ID, and every selected menu ID. When I go to the next record I read from the join table and populate the selected menu items.
This is one way of making a Many To Many form where you choose from a list, and it works well.

The other solution to this is a completely unbound form. The level of difficulty goes way up.
 
I am using a bound subform and I tried to use the conditional formating but it didn't allow me to use it on check boxes. Is there any way in the code to select one row in a continuous form and then modify just that one row?
 
Role your own Checkbox, using a textbox and put and X in it. something like this for control source. "blnSelected" represents your field name.

=iif(blnSelected,"X","")

now use conditional formatting on the textbox
 
If you role your own you might want something like:

Private Sub txtBoxMyCheckBox_Click()
Me.blnSelected = Not Me.blnSelected
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top