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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Check Condition for Checkboxes- True or Yes or What?

Status
Not open for further replies.

rmtiptoes

IS-IT--Management
Mar 30, 2004
55
US
I am trying to print a report based upon the condition that a checkbox is checked in the database. I have tried to
' If CompleteStatus = True' and ' If CompleteStatus = Yes' and neither works. When I put in a message box to display the value, it shows nothing. What If conditiion do I use?


Private Sub Print2_Click()
On Error GoTo Err_Print2_Click

Dim strDocName As String
Dim strWhere2 As String
'Dim strComplete As String

strDocName = "Assets_New"
strWhere = "[Asset ID Number]='" & Me![Asset ID Number] & "'"
strWhere2 = CompleteStatus = Me![CompleteStatus]
MsgBox CompleteStatus
'strComplete = Me![CompleteStatus].Value
If CompleteStatus = True Then
DoCmd.OpenReport strDocName, acPreview, , strWhere2
Else
MsgBox "You have selected to print an asset that is not complete. Please " & _
"review the asset record and check the 'Complete' Status box."
End If

Exit_Print2_Click:
Exit Sub

Err_Print2_Click:
MsgBox Err.Description
Resume Exit_Print2_Click

End Sub


Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.

 
Hi

"a checkbox is checked in the database"

"MsgBox CompleteStatus"

Where is "CompleteStatus", on a form, or in a data table?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
rmtiptoes,
strWhere2 = CompleteStatus = Me![CompleteStatus]
Not sure what you're trying to do with this statement. Can you elaborate?

Ken S.
 
I have actually removed this now and it works great. Thank you very much. I was trying to get it to work but the earlier responses solved the problem.

Thanks again!!

Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top