Checkbox per record

S

Steve

Hi

Not sure if my subject tells a lot.

Essentially I want to have a checkbox per record. This in
not a problem. Depending on whether the checkbox is true
or false I want to show another field for the user to
fill in. Again this seems to be OK.

However, if the checkbox is on it turns the other field
off BUT when i go to the next record where the checkbox
is off, the other field still remains off. i.e. the code
seems to work for all records rather than just the one.

The code is as follows:

If Me!UseAMW.Value = True Then
Me!Other.Visible = False
Else
Me!Other.Visible = True
End If

At the moment I have it on after update but have also
tried on Click.

Please Help.

Best Regards

Steve
 
P

Pavel Romashkin

If your check box is not bound, it will keep its value when you move to
the next record.
If it is bound, put your code in the Current event of your form and it
should work just fine.
You can make it a little more efficient:

Me!Other.Visible = Not Me!UseAMW

Pavel
 
S

Steve

Sorry for being stupid, but new to this.

How do you make it bound?

Thanks for you help

Steve
 
S

Steve

Thanks

That code worked great. Just not sure what is mean't by
the current event of the form.

Steve
 
T

tina

leave your code on the checkbox's AfterUpdate event, it
works fine there. just add the same code to your form's
OnCurrent event; that way the "Other" control will be
shown or hidden appropriately as you move from record to
record.

hth
 
R

Rick Brandt

Steve said:
Sorry for being stupid, but new to this.

How do you make it bound?

Bound means that the control (CheckBox) is using a field in the underlying
table as its ControlSource. If a control is simply added to a form without
being "attached" to a field in the table then it cannot display a value
"per-row" in a continuous or datasheet view form.
 
G

Guest

Fantastic

Thank you very much Tina.

If it's of any consolation, I'm a quick learner and
shouldn't ask this again. I'm sure I can find another
particularly stupid question to ask.

Regards

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top