I have a couple of issues:
1) I'm trying to get a checkbox to become checked if certain values are
entered. For instance, if my "date" text box has any value, I'd like the
checkbox to become checked. I'm assuming I will have to extract the value
from the field for the individual record, but I'm not sure how to do this.
2)Is there a good way to update this upon value changes? Right now I'm
setting this to update whenever the mouse is moved on the form.
Thanks!
AndyM - 02 Mar 2006 21:58 GMT
Ok, I figured out the first part, to extract the value, I just typed
Me.Fieldname
Does anyone have any suggestions for the second part?
Thanks
> I have a couple of issues:
> 1) I'm trying to get a checkbox to become checked if certain values are
[quoted text clipped - 6 lines]
>
> Thanks!
John Vinson - 02 Mar 2006 22:41 GMT
>I have a couple of issues:
>1) I'm trying to get a checkbox to become checked if certain values are
[quoted text clipped - 6 lines]
>
>Thanks!
The yes/no field should NOT be stored in any table, if its value in
fact depends on the date field.
Instead, just calculate it dynamically. For instance, on a Form or
Report you can have a checkbox control with a rowsource of
=Not IsNull([datefield])
John W. Vinson[MVP]
Steve Schapel - 03 Mar 2006 07:55 GMT
Andy,
If I understand what you want correctly, I would say you need to put
some code on the After Update event of the "date" textbox, something the
equivalent of this...
Me.NameOfYourCheckbox = Not IsNull(Me.NameOfYourDateTextbox)
It's a puzzle, though, what the purpose of this would be. I mean, if
the date box is empty, you can see that it's empty, without needing a
checkbox to tell you so? Or have I meesed the point?

Signature
Steve Schapel, Microsoft Access MVP
> I have a couple of issues:
> 1) I'm trying to get a checkbox to become checked if certain values are
[quoted text clipped - 6 lines]
>
> Thanks!
AndyM - 03 Mar 2006 14:54 GMT
Steve and John,
Thanks for your help. The purpose of the checkbox is to be checked if
multiple conditions apply. For one, the date box must have an entry, I also
have a "Stress" text box which, if left null or changed to "inbox", to allow
the checkbox to become checked, otherwise I need the checkbox to become
unchecked. In the end, I want to develop a filter that will only bring up
records that have the checkbox checked. I imagine I wil have to do this
through a series of if statements. Does that seem right?
Thanks Again
Andy
> Andy,
>
[quoted text clipped - 17 lines]
> >
> > Thanks!
John Vinson - 03 Mar 2006 17:23 GMT
>Steve and John,
>Thanks for your help. The purpose of the checkbox is to be checked if
[quoted text clipped - 4 lines]
>records that have the checkbox checked. I imagine I wil have to do this
>through a series of if statements. Does that seem right?
Yep. Sounds like you might want to write a custom VBA function which
goes through the logic tree; something like
Private Function ShowCheck(vDate As Variant, vStress As Variant,
<other possible arguments>) As Boolean
If IsNull(vDate) Then
<do something appropriate>
...
End Function
In the function you would set ShowCheck to True or False
appropriately. On the Form you'ld set a checkbox control's Control
Source to
=ShowCheck([txtDate], [txtStress], [ThisControl], [ThatControl])
to automatically display the appropriate check.
John W. Vinson[MVP]
AndyM - 03 Mar 2006 18:04 GMT
Thanks a ton- you've been very helpful.
--andy
> >Steve and John,
> >Thanks for your help. The purpose of the checkbox is to be checked if
[quoted text clipped - 24 lines]
>
> John W. Vinson[MVP]