Check Boxes / Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have three check boxes in my form. How to you make it where one is
checked, and other two are not?

I have a field in my form that calculates the days between two dates. When
I run a query to get the elasped time (days), I find the field in the query
is blank; The table that has the field is also blank. For some reason, this
information is not being inputted into the table/query from my form.

Thanks for your help in advance.
--
 
David, you were on target with about the option group. Do you have an answer
for my second situation?
--



David F Cox said:
Perhaps put the check boxes in an option group? see help.
 
You are not storing the value, but that is probably good news. Normally if
you can calculate a value based on other fields in the record, you don't
store it. When you need the value, you calculate it.

If you really feel the need to store the value, you will need to change your
form. You will probably need to use some VBA to calculate the value and
assign the value to a control bound to the elapsed time field or control.

Simplest method is to change the existing control on the form., so its
control source is your elapsed time field.

Then in the After UPDATE event of the controls that contain the information
that you use to calculate the elapsed time you would have something like the
following.

In the After Update on the Event Tab: Select [Event Procedure], then click
the three dot button at the end of the line. You do need to do this for all
the controls involved in the calculation.

Private Sub txtStart_AfterUpdate()
IF IsDate(Me.TxtStart) and IsDate(Me.TxtEnd)
Me.txtElapsedTime = DateDiff("d",Me.TxtStart, Me.txtEnd)
Else
Me.txtElapsedTime = Null
End IF
End Sub

Obviously, you need to substitute the names of your controls for the generic
names I've used.



rshed said:
David, you were on target with about the option group. Do you have an
answer
for my second situation?
 
Back
Top