Text Boxes

kbreiss

Registered User.
Local time
Today, 20:24
Joined
Oct 1, 2002
Messages
228
I have a check box placed in front of a text box that contains project titles. The user clicks the check box to view reports of the desired project titles.

My problem is after the last check & text box access puts a blank check & text box. If a user accidentally selects it says the "project title can't contain a null value."

Is there any way I can just turn something off so the form does not display the empty check & text box after the last record?

Any advice would be greatly appreciated.

Kacy
________
LovelyWendie99
 
Last edited:
Kacy,

You can set the Project field (Locked=Yes).

Then for the checkbox, use a beforeUpdate event:

If IsNull(Me.Project) Then
Me.CheckBox = False
End If

hth,
Wayne
 
I'm not for sure if I did it right, but when i click on the checkbox that contains the empty project I receive a run time error 2115. "The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Access from saving the data in the field. Is this what it should do?

Thanks for the advice,

Kacy
________
MARIJUANA VAPORIZER
 
Last edited:
Kacy,

Just get your form in design mode and set the
form's AllowAdditions property to No.

Wayne
 
I'm receiving the same 2115 runtime error with the following piece of code. There are no validation rules or macros on the field.

Code:
Private Sub Activity_Status_Click()
    If Me.Activity_Status = False Then
        Me.Delete_Date = Date
        MsgBox "Please enter a reason for inactivating this user.", vbOKOnly, "Security Access Database"
        Me.Delete_Reason.SetFocus
        Me.Delete_Reason.Text = Me.Delete_Reason.Text & " Inactivated by " & fGetOSUserName & " " & Date
    Else
        Me.Delete_Date = ""
        Me.Delete_Reason.SetFocus
        Me.Delete_Reason.Text = Me.Delete_Reason.Text & " Reactivated by " & fGetOSUserName & " " & Date
    End If

End Sub
 
Fixed it like this:

Code:
Private Sub Activity_Status_Click()
Dim deletetxt As String
    If Me.Activity_Status = False Then
        Me.Delete_Date = Date
        MsgBox "Please enter a reason for inactivating this user.", vbOKOnly, "Security Access Database"
        Me.Delete_Reason.SetFocus
        deletetxt = Me.Delete_Reason.Text
        Me.Delete_Date.SetFocus
        Me.Delete_Reason.Value = deletetxt & " Inactivated by " & fGetOSUserName & " " & Date
        Me.Delete_Reason.SetFocus
    Else
        Me.Delete_Date = ""
        Me.Delete_Reason.SetFocus
        deletetxt = Me.Delete_Reason.Text
        Me.Delete_Date.SetFocus
        Me.Delete_Reason.Value = deletetxt & " Reactivated by " & fGetOSUserName & " " & Date
    End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom