A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

New record vs. old record



 
 
Thread Tools Display Modes
  #1  
Old January 19th, 2009, 04:21 PM posted to microsoft.public.access.gettingstarted
gd
external usenet poster
 
Posts: 209
Default New record vs. old record

How do I get an auto date for new records on a form, but have previous
records refer back to the table for their date? I tried:

Private Sub cboEnteredBy_AfterUpdate()
If Me.NewRecord And Me.cboEnteredBy "" Then
Me.txtEntryDate = Now()
Else
Me.txtEntryDate = ""
End If

End Sub

in this event + the Form_Current, but it erased the dates of the previous
record's txtEntryDates. Can anyone help?

Thanks!!!

--
GD
  #2  
Old January 19th, 2009, 04:31 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default New record vs. old record

Uhmmm?

Your "Else" statement tells Access to erase any value in the txtEntryDate
field if it isn't a new record?


--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"GD" wrote in message
...
How do I get an auto date for new records on a form, but have previous
records refer back to the table for their date? I tried:

Private Sub cboEnteredBy_AfterUpdate()
If Me.NewRecord And Me.cboEnteredBy "" Then
Me.txtEntryDate = Now()
Else
Me.txtEntryDate = ""
End If

End Sub

in this event + the Form_Current, but it erased the dates of the previous
record's txtEntryDates. Can anyone help?

Thanks!!!

--
GD


  #3  
Old January 19th, 2009, 04:56 PM posted to microsoft.public.access.gettingstarted
gd
external usenet poster
 
Posts: 209
Default New record vs. old record

Exactly. So how would I word it if I wanted old records to rely on the
table's field?
--
GD


"Jeff Boyce" wrote:

Uhmmm?

Your "Else" statement tells Access to erase any value in the txtEntryDate
field if it isn't a new record?


--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"GD" wrote in message
...
How do I get an auto date for new records on a form, but have previous
records refer back to the table for their date? I tried:

Private Sub cboEnteredBy_AfterUpdate()
If Me.NewRecord And Me.cboEnteredBy "" Then
Me.txtEntryDate = Now()
Else
Me.txtEntryDate = ""
End If

End Sub

in this event + the Form_Current, but it erased the dates of the previous
record's txtEntryDates. Can anyone help?

Thanks!!!

--
GD



  #4  
Old January 19th, 2009, 05:06 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default New record vs. old record

Private Sub cboEnteredBy_AfterUpdate()
If Me.NewRecord Then
If Me.cboEnteredBy "" Then
Me.txtEntryDate = Now()
Else
Me.txtEntryDate = Null
End If
End If
End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"GD" wrote in message
...
Exactly. So how would I word it if I wanted old records to rely on the
table's field?
--
GD


"Jeff Boyce" wrote:

Uhmmm?

Your "Else" statement tells Access to erase any value in the txtEntryDate
field if it isn't a new record?


--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"GD" wrote in message
...
How do I get an auto date for new records on a form, but have previous
records refer back to the table for their date? I tried:

Private Sub cboEnteredBy_AfterUpdate()
If Me.NewRecord And Me.cboEnteredBy "" Then
Me.txtEntryDate = Now()
Else
Me.txtEntryDate = ""
End If

End Sub

in this event + the Form_Current, but it erased the dates of the
previous
record's txtEntryDates. Can anyone help?

Thanks!!!

--
GD





  #5  
Old January 19th, 2009, 06:23 PM posted to microsoft.public.access.gettingstarted
gd
external usenet poster
 
Posts: 209
Default New record vs. old record

Works great! Thanks for the knowledge, Doug.
--
GD


"Douglas J. Steele" wrote:

Private Sub cboEnteredBy_AfterUpdate()
If Me.NewRecord Then
If Me.cboEnteredBy "" Then
Me.txtEntryDate = Now()
Else
Me.txtEntryDate = Null
End If
End If
End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"GD" wrote in message
...
Exactly. So how would I word it if I wanted old records to rely on the
table's field?
--
GD


"Jeff Boyce" wrote:

Uhmmm?

Your "Else" statement tells Access to erase any value in the txtEntryDate
field if it isn't a new record?


--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"GD" wrote in message
...
How do I get an auto date for new records on a form, but have previous
records refer back to the table for their date? I tried:

Private Sub cboEnteredBy_AfterUpdate()
If Me.NewRecord And Me.cboEnteredBy "" Then
Me.txtEntryDate = Now()
Else
Me.txtEntryDate = ""
End If

End Sub

in this event + the Form_Current, but it erased the dates of the
previous
record's txtEntryDates. Can anyone help?

Thanks!!!

--
GD





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.