knarlyd@hotmail.com
Registered User.
- Local time
- Today, 07:43
- Joined
- Sep 6, 2013
- Messages
- 43
I found some code to check if all the fields in a form are complete, and if not, highlight and not allow Save until all fields are complete.
The issue I'm having is with another piece of code from Allen Browne (ajbFindAsUType) that finds records as you type.
The code that checks for the blank fields also highlights the unbound control on that function, which is where users enter a value to search upon.
Can someone explain (if possible) how to not check that field for a value?
Any help would be greatly appreciated as I know very little about VBA.
I'd post the database but it has confidential information.
Here's the code for validating the form:
Private Function ValidateFormComplete() As Boolean
Dim Ctr As Control
Dim FoundError As Boolean
Stop
FoundError = False
For Each Ctr In Me.Controls
Select Case Ctr.ControlType
Case acComboBox, acTextBox, acCheckBox
If IsNull(Ctr.value) Or Ctr.value = "" Then
Ctr.BackColor = RGB(223, 167, 165)
FoundError = True
Else
Ctr.BackColor = RGB(255, 255, 255)
End If
End Select
Next Ctr
If Not FoundError Then
ValidateFormComplete = True
Else
ValidateFormComplete = False
End If
End Function
The issue I'm having is with another piece of code from Allen Browne (ajbFindAsUType) that finds records as you type.
The code that checks for the blank fields also highlights the unbound control on that function, which is where users enter a value to search upon.
Can someone explain (if possible) how to not check that field for a value?
Any help would be greatly appreciated as I know very little about VBA.
I'd post the database but it has confidential information.

Here's the code for validating the form:
Private Function ValidateFormComplete() As Boolean
Dim Ctr As Control
Dim FoundError As Boolean
Stop
FoundError = False
For Each Ctr In Me.Controls
Select Case Ctr.ControlType
Case acComboBox, acTextBox, acCheckBox
If IsNull(Ctr.value) Or Ctr.value = "" Then
Ctr.BackColor = RGB(223, 167, 165)
FoundError = True
Else
Ctr.BackColor = RGB(255, 255, 255)
End If
End Select
Next Ctr
If Not FoundError Then
ValidateFormComplete = True
Else
ValidateFormComplete = False
End If
End Function