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

Code for 1 Record in Subform

Status
Not open for further replies.

theog

Programmer
May 1, 2001
13
US
It's a little thing, but it's killin' me...

I have the standard form w/ subform. The user makes a combobox selection on the main form to select a record to which to add associated data in the subform. The subform is set to 'continuous forms' to allow lots of easy data entry. So far so good...

Now, in the subform, there is a checkbox field and two textboxes after it. We'll call them chk1, txtA and txtB, respectively. Using chk1's AfterUpdate event, if chk1 is checked, I want txtA enabled and txtB disabled. If chk1 is not checked, I want txtA disabled and txtB enabled. Simple enough...

I can successfully do this with a simple conditional statement that checks the value of chk1, BUT, my code to enable or disable the checkboxes is applied to ALL the records in my subform. I just want to work with the current record, but I can't seem to find a way to do it. Seems like it'd be such a simple thing, but I'm stumped...

Thanks in advance. Ted
 
If there's a way around that, it's using API calls, might check the FAQs here to see. But in any case, it shouldn't matter, since the user is only working with the text boxes and check box on that record, presumably. You just need to call the same code in the subform's OnCurrent event to reset the current record for its checkbox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top