Generate a "Case Closed" text box

pablotx

Registered User.
Local time
Today, 10:03
Joined
Feb 20, 2003
Messages
79
I have developed a tracking database for abuse incidents. I want to add a command button that will pop up a statement Case Closed on the form somewhere. I want the field to be invisible until someone clicks on the button. Can't figure out how to do it. Also, could I also assign that field to my table so that I could compile what cases are closed. Sounds simple enough, but I haven't figured it out yet. Thanks for any assistance you can provide.
 
1) Your form should be bound to a table or query
2) Place on this form control(textbox or check box) bounded to a field.
3) In control property find Visible and set it to "No"
4) Place command button on your form and provide in VBA code window
Private Sub Command1_Click()
YourControlName.Visible=True
End Sub
 
This should get you started...

Add a CaseClosed field to your table. Format it as a Yes/No field. Add a check box field to your form and bind it to the new field in your table [record source]. Create a label to display your Case Closed message. Using the OnCurrent event of the form and also the AfterUpdate event of the CaseClosed check box, you could add some code to either hide or display the Case Closed label.
Code:
Private Sub cbCaseClosed_AfterUpdate()
    
    If Me.cbCaseClosed.Value = -1 Then
        Me.lblCaseClosed.Visible = True
    Else
        Me.lblCaseClosed.Visible = False
    End If
    
End Sub
This will not work for a continous form. Access 2000 and newer will allow you to use conditional formatting.

HTH
 
ghudson said:
Add a CaseClosed field to your table. Format it as a Yes/No field.

Can I just suggest a Date/Time field rather than a Yes/No field? The former offers more information than a simple yes or no.

And rather than evaluating if it's 0 or -1 then the IsDate() function can be used to determine the same values.

i.e

Code:
Me.lblCaseClosed.Visible = IsDate(Me.txtCaseClosed)
 
On a report too?

How would I be able to accomplish a very similiar task but on a report not a form? I can't add anything to the afterupdate because that is not available.

Thanks
 

Users who are viewing this thread

Back
Top Bottom