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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA syntax to check if new entry in table 1

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I have a form that allows a user to go through all of the entries in a table as well as add a new entry to that table. On my form, I have a text box that I want to display only when the user is entering a new record. Is there VBA syntax that will allow me to do this? Thanks so much!!

Private Sub Form_Current()
'If this is a new entry Then <-- What is the syntax?
txtDate.Visible=True
'Else
'Don't show text box
'End if

End Sub
 
Dim MyNewrec as Integer

MyNewRec = frmName.NewRecord

If MyNewRec = True Then
txtDate.visible = True
EndIf

This should do it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top