Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate check box if date field has a date

Status
Not open for further replies.

iamtrying

Technical User
Sep 28, 2004
128
US
Hi, how do I populate a check box with a check mark(field=scheduled)if a date field (next_biennial) is populated with a date?

Thanks
 
A starting point:
[scheduled] = IsDate([next_biennial])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV

When I create this as an expression in after update, I do not get the desired results. I need more help

=[Scheduled]=IsDate([Next_Biennial])
 
iamtrying . . .

Use only [blue]=IsDate([Next_Biennial])[/blue]


Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
TheAceMan1

My objective is to show the check mark in the check box (Scheduled) if the NextBiennial field is populated with a date. I have placed the code in "After Update", but the check box does not populate.
 
So the checkbox and textbox are on a form? Then, in the textbox's AfterUpdate event:

Code:
If IsDate(txtTextBoxName) Then
    chkCheckboxName = True
Else
    chkCheckboxName = False
End If


-V
 
This code currently exist in the AfterUpdate event:

Next_Biennial = DateAdd("yyyy", 2, Last_Biennial)

Will it affect the code you posted -->

If IsDate(txtTextBoxName) Then
chkCheckboxName = True
Else
chkCheckboxName = False
End If

I added the code but the checkbox does not populate automatically. Well there is always the manual mode

 
Well you need to replace txtTextBoxName and chkCheckboxName with the names of your controls...

If you are setting Next_Biennial right there, won't it always contain a date?


-V
 
It will contain a date 2 years in advance based on Last_Biennial -->

Next_Biennial = DateAdd("yyyy", 2, Last_Biennial)

I did place my control names in AfterUpdate

Private Sub Next_Biennial_AfterUpdate()
If IsDate(Next_Biennial) Then
Scheduled = True
Else
Scheduled = False
End If
End Sub

I will keep trying

 
Your original question was:

Hi, how do I populate a check box with a check mark(field=scheduled)if a date field (next_biennial) is populated with a date?

If it is always going to be populated with a date, why do you need to determine if it is a date or not?


-V
 
The user made a request to see a check mark to show that a required exam has been scheduled. I agree, if there is a date in the field, the exam has been scheduled. I am not trying to determine if there is a date. I am trying to show a check mark if the date field is populated with a date.
 
So what is wrong with TheAceMan1's suggestion of setting the checkbox's ControlSource property to [blue]=IsDate(TextboxName)[/blue] ?


-V
 
There is nothing wrong now that I have placed it in the ControlSource Property. I was going about it the wrong way.
 
Thamk you VRoscioli . . .

[blue]I was hoping someone would get it! [thumbsup2] . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top