Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable a button only when form is in acFormAdd?

Status
Not open for further replies.

dgirl1010

Technical User
Jul 14, 2006
20
US
I'm fairly new to VBA, and I'm trying to do an If Then statement that will allow a button on my form to becaome enabled only when the form is in data entry mode, acFormAdd, but it doesn't seem to like what I'm doing. Is this even possible?

Here's what I've tried:
If Forms!ProjectDetails!acFormPropertySettings = acFormAdd Then
Forms!ProjectDetails!cmdCommit_Click.Enabled = True
End If
 
How about:
[tt]Forms!ProjectDetails.DateEntry =True[/tt]

There is also a property NewRecord that you may wish to look at.
 
Wahoo! The NewRecord idea worked! Here's what I did:

Dim intnewrec As Integer
intnewrec = Me.NewRecord
If intnewrec = True Then
Forms!ProjectDetails!cmdCommit.Enabled = True
End If


Rock on! Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top