Change in one Row affects all the Rows

asanjose

Registered User.
Local time
Today, 17:31
Joined
Mar 2, 2010
Messages
14
I have a form that lists several Items (in "Continuous Forms" view).

Next to the Item Name, I have a checkbox.
The checkbox determines if the Item has a price.
If the checkbox is clicked by the user, a hidden textbox named "Price" becomes Visible.

Private Sub HasPrice_Click()

If HasPrice = True Then
Me.Price.Visible = True
Else
Me.Price.Visible = False
End If

End Sub


My problem is that, when you click the checkbox, the hidden textbox appears not only for that specific row, but for ALL the rows.

Any help at all is very much appreciated. :)

Thanks,
Asan

beforep.jpg
afterb.jpg
 
Try your code in the OnCurent event of the subform. Then you might have to use some conditional coding to display the price field if it is not null.
 
Hi GHudson,

Thanks for the quick reply. I tried transferring the code over to the OnCurrent but it is still behaving the same way.

I'm thinking maybe "me.price.visible" is the wrong way to go because it affects all the Price textboxes throughout the form.

I need a way to target a textbox in a specific row.

Thanks again,
Asan
 
I'm guessing the Add Price check box is not a bound control?
 
Here's one of the cheats way around the problem
 

Attachments

Thanks Rich

That's a neat trick hiding the textbox in the background using color and setting focus on it to highlight it when needed. :)
 

Users who are viewing this thread

Back
Top Bottom