Setting default value on the fly

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bruce (anonymous_at_discussions.microsoft.com)
Date: 05/10/04


Date: Mon, 10 May 2004 06:25:19 -0700

I answered the first part of my question by placing Me!
YourCheckBoxControlName.DefaultValue = True into the
form's On Current event. The date question continues to
vex me. I don't know if you are still monitoring this
thread, so i will start a new one with just the date
question. Thanks again for your help.
>-----Original Message-----
>One way to handle the verification is to include a
command
>button to toggle the default value. Set your default
>value equal to True in form design mode. In the OnClick
>event of the command button:
>
> Me!YourCheckBoxControlName.DefaultValue = _
> Not Me!YourCheckBoxControlName.DefaultValue
>
>For the date, one easy way is to set the default value in
>the field's AfterUpdate event:
>
> Me!YourDateControlName.DefaultValue = _
> Me!YourDateControlName
>
>HTH
>Kevin Sprinkel
>
>
>>-----Original Message-----
>>I have a database for recording training information.
>>There is a main form to record session information
>>(subject, instructor, etc.), and a subform to record
>>attendance. The form and the subform are each bound to
>>their own table. The subform's table is a junction
table
>>between the Employees table and the Sessions table (each
>>session has many attendees; each employee attends many
>>sessions). The subform (and its underlying table) has
>>fields for name, date, and a check box
>>labeled "Verified". I would like a way of having the
>>default value of the check box be "No", but with a way
of
>>setting the check box value to "Yes" for all attendees.
>>The reason is that sometimes the manager will set up in
>>the database a training session for a specific listed
>>group of employees, in which case attendance is not
>>verified until later, when the session is complete. In
>>other cases the training record will be handwritten, in
>>which case attendance can be verified as the training
>>session is being entered into the database. I know I
can
>>set the default value of the check box in the table, but
>I
>>would like to be able to change it on the form (with a
>>command button?), so that in the second case mentioned
>>above (handwritten record), all names entered will
>>automatically have a check mark in "Verified".
>>In a possibly related question, I would like for the
>>default date next to each employee's name to be the same
>>as for the previously listed employee at that session.
>>90% of the time that is the case; sometimes, though,
>>because of different shifts, etc., it is not, which is
>why
>>I cannot just put the date into the general session
>>information.
>>.
>>
>.
>


Quantcast