Without commenting on the logic overall, I think the syntax you're looking for to count non-null records in tbl_proposal would require you to specify which field in tbl_proposal should be counted...if you want to specify non-nulls.
Without commenting on the logic overall, I think the syntax you're looking for to count non-null records in tbl_proposal would require you to specify which field in tbl_proposal should be counted...if you want to specify non-nulls.
What exactly happens? Tell us what did happen if anything.
Do you get an error?
You might have to use Me.
Me.cmdProposals.ForeColor = vbRed
Me.cmdProposals.FontBold = True
Me.cmdProposals.FontSize = 14
The Form load event occurs once at the beginning. When do you want the command to change?
I don't see any code to reset the cmdProposals to a default/other color.
I am thinking also that I need to specify which field in the proposal table should be counted?
I have tried the following on load event on the main form where the command button that opens the proposals is located.
Private Sub Form_Load()
Dim records As Integer
records = Nz(DCount("*", "tblProposal"), 0)
If (records > 0) Then
Me.Proposal_Button.ForeColor = vbRed
Me.Proposal_Button.FontBold = True
Me.Proposal_Button.FontSize = 14
End If
End Sub
The [records = Nz(DCount("*", "tblProposal"), 0)] becomes yellow like this is where the error is.
Thanks Angie
I was thinking that instead of using a proposal table, could we use a field in the proposal form like "proposal" or "proposal date" these two field are not completed unless a new proposal is entered.
The form is called "proposal" and the fields to use is "proposal" or "proposal date"
The name of the command button that is on the main form customer is named [proposal button] which opens the proposal form.
Maybe this will help a little. Thanks