Enable Button Due To Criteria?

That's my normal mode of operations (only because the db's I write are mostly for personnel that have no db experience at all, or temp hires for $5.75 and hour).

That being said, read Linq's last post because you will now be forced to disable other items so user's can't bypass the command button.

-dK
 
Ok. Thanks guys for your help and patience with my issue! I will give everyone some reputation. It actually worked the way I thought of....by enabling the Save button a searching the 4 fields to see if they are not null. I appreciate your help.
 
We crossed posts last time. If you look at my last you see another problem with the approach of enabling/disabling your Save button. Here's the standard way of doing this. You can still have your "Save" button, if you like, but this code will assure that all fields are filled in, regardless of how the users try to save the record.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
 If IsNull(Me.CompanyName) Then
   MsgBox "You Must Enter a Company Name!"
   Cancel = True
   Me.CompanyName.SetFocus
  ElseIf IsNull(Me.Address) Then
   MsgBox "You Must Enter a Company Address!"
   Cancel = True
   Me.Address.SetFocus
  ElseIf IsNull(Me.City) Then
   MsgBox "You Must Enter a City!"
   Cancel = True
   Me.City.SetFocus
  ElseIf IsNull(Me.State) Then
   MsgBox "You Must Enter a State!"
   Cancel = True
   Me.State.SetFocus
  End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom