Hi all- New here..
I'm having an issue (I have done some searches but was affraid to update threads over a year old).
The idea is to not have the Save Entry button enabled unless all the fields have criteria. There are two fields that auto populate data and are not in the code below, I assume they didn’t need to be because they will never be null.
My Issue:
The save button is not becoming enabled after all fields have data.
FYI the first 3 in the below code are combo boxes, me.description is a text box…
Also, I am placing this code in the events sections of the Form selection type in the Forms Property Sheet.
P.S. I have tried this On Current, On Dirty, and Before Update to no avail. In my head I would think the form would have to do some type of refresh in order to register whether there is any data populated in the fields. I’m also somewhat new to VBA, so please be easy on me. Thanks.
I'm having an issue (I have done some searches but was affraid to update threads over a year old).
The idea is to not have the Save Entry button enabled unless all the fields have criteria. There are two fields that auto populate data and are not in the code below, I assume they didn’t need to be because they will never be null.
My Issue:
The save button is not becoming enabled after all fields have data.
FYI the first 3 in the below code are combo boxes, me.description is a text box…
Also, I am placing this code in the events sections of the Form selection type in the Forms Property Sheet.
Code:
[COLOR=black]Private Sub Form_BeforeUpdate(Cancel As Integer)[/COLOR]
[COLOR=black]If IsNull(Me.Workstream) And IsNull(Me.Activity) And IsNull(Me.Hours) And IsNull(Me.Description) Then[/COLOR]
[COLOR=black]Me.SaveEntry.Enabled = False[/COLOR]
[COLOR=black]Else[/COLOR]
[COLOR=black]Me.SaveEntry.Enabled = True[/COLOR]
[COLOR=black]End If[/COLOR]
[COLOR=black]End Sub[/COLOR]
P.S. I have tried this On Current, On Dirty, and Before Update to no avail. In my head I would think the form would have to do some type of refresh in order to register whether there is any data populated in the fields. I’m also somewhat new to VBA, so please be easy on me. Thanks.