TheEvilBankers
Registered User.
- Local time
- Today, 08:17
- Joined
- Aug 13, 2003
- Messages
- 33
Enabling and Disabling buttons on a Form based on criteria found in a Table
We have a form that has two buttons one is a normal print button the other is a reprint button. Upon opening the database we would like it to check the date in a table called FSU to see if a record has been generated for the day. If there is a record then the reprint button will be active and visa versa.
This is the code we have...
Private Sub Form_Load()
Dim strDate As String
Dim rsDateCheck As New ADODB.Recordset
rsDateCheck.Open "FSU", CurrentProject.Connection
rsDateCheck.MoveFirst
If strDate = Date Then
Me.Reprint_FSU.Enabled = True
Me.FSU_print.Enabled = False
End If
rsDateCheck.Close
End Sub
Thanks.
A and K
We have a form that has two buttons one is a normal print button the other is a reprint button. Upon opening the database we would like it to check the date in a table called FSU to see if a record has been generated for the day. If there is a record then the reprint button will be active and visa versa.
This is the code we have...
Private Sub Form_Load()
Dim strDate As String
Dim rsDateCheck As New ADODB.Recordset
rsDateCheck.Open "FSU", CurrentProject.Connection
rsDateCheck.MoveFirst
If strDate = Date Then
Me.Reprint_FSU.Enabled = True
Me.FSU_print.Enabled = False
End If
rsDateCheck.Close
End Sub
Thanks.
A and K