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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Text value of last record



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2008, 08:45 PM posted to microsoft.public.access.forms
kuslusr1
external usenet poster
 
Posts: 8
Default Text value of last record

I am tracking site hazard inspection reports, multiple items are turned in by
the same inspector and the same inspection support group. I would like to add
new form records (specific hazards) and have the inspector and support group
fields populate based on the last date enter to minimize key strokes. The
information that was last enter would populate in the new record fields with
edits allowable. Once edits were made, this would become the last record
information and would update new records.
--
kuslusr1
Ads
  #2  
Old April 27th, 2008, 09:30 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Text value of last record

If you're talking about entering a series of new records and having the
inspector and support group from one record carry forward to the next group,
you can use the AfterUpdate event of the control holding your data to set the
DefaultValue for the field. From that time forward, until you either manually
change the data or close your form, the data will be entered automatically in
each new record. The syntax is slightly different, depending on the datatype
of the data:

For Text fields

Private Sub YourTextControlName_AfterUpdate()
If Not IsNull(Me.YourTextControlName.Value) Then
YourTextControlName.DefaultValue = """" & Me.YourTextControlName.Value &
""""
End If
End Sub

For Numeric fields

Private Sub YourNumericControlName_AfterUpdate()
If Not IsNull(Me.YourNumericControlName.Value) Then
YourNumericControlName.DefaultValue = Me.YourNumericControlName.Value
End If
End Sub

For Date fields

Private Sub YourDateControlName_AfterUpdate()
If Not IsNull(Me.YourDateControlName.Value) Then
YourDateControlName.DefaultValue ="#" & Me.YourDateControlName & "#"
End If
End Sub

If you're talking about having these fields carry forward with the form being
closed then re-opened netween records, that a little more complicated. If
this is the case post back.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200804/1

 




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 01:00 AM.


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