Auto Filling Fields in Current Record from Previous Record

Hello,

I have looked through posts related to Auto-Filling a field from a
previous record but am still a little unsure of how to do things.
What I would like to do is auto fill a field in the current record
with one from a different field in a previous record.  What I have is
a form that records "engine hours" and "tonnes moved" for a piece of
equipment.  The operator will record the staring hours and tonnes (at
the start of a day) and the hours and tonnes at the end of the day.
So in the database, I would like the "Starting Hours" and "Starting
Tonnes" on the current/new record to fill with the "Ending Hours" and
"Ending Tonnes" from the previous record.  Is this accomplished with
Microsoft's "AutoFill" function on their website or do I need to
change it a bit.

Thanks in advance,

John

0
J
5/14/2007 10:16:47 PM
access 16762 articles. 3 followers. Follow

1 Replies
1905 Views

Similar Articles

[PageSpeed] 36

On May 15, 3:21 am, Andy Hull <AndyH...@discussions.microsoft.com>
wrote:
> I would use dlookup...
>
> In the On Current event of the form use something like...
>
> if me.newrecord then
> me.starting_hours = dlookup("Ending Hours", "TableName", "DateField = #" &
> format(dmax("DateField", "TableName"), "mm/dd/yyyy") & "#")
> end if
>
> Essentially, this looks up the Ending Hours of the record with the maximum
> date.
> If there are several pieces of equipment then you will need to restrict the
> above further to use that equipment's id.
> I've also assumed one entry per date.
>
> Hope this points you in the right direction
>
> Andy Hull
>
>
>
> "J. Trucking" wrote:
> > Hello,
>
> > I have looked through posts related to Auto-Filling a field from a
> > previous record but am still a little unsure of how to do things.
> > What I would like to do is auto fill a field in the current record
> > with one from a different field in a previous record.  What I have is
> > a form that records "engine hours" and "tonnes moved" for a piece of
> > equipment.  The operator will record the staring hours and tonnes (at
> > the start of a day) and the hours and tonnes at the end of the day.
> > So in the database, I would like the "Starting Hours" and "Starting
> > Tonnes" on the current/new record to fill with the "Ending Hours" and
> > "Ending Tonnes" from the previous record.  Is this accomplished with
> > Microsoft's "AutoFill" function on their website or do I need to
> > change it a bit.
>
> > Thanks in advance,
>
> > John- Hide quoted text -
>
> - Show quoted text -

Thanks Andy.  Worked great!

0
J
5/15/2007 1:13:55 PM
Reply:

Similar Artilces:

What can an Account record be converted from?
The Account record has a 'Originating Lead' field but I cannot see how to convert from the Lead record? If you have a Lead record opened, there's a "Convert Lead..." button on the grid, and there's also a "Convert Lead..." option in the Actions menu. "Agile CRM" wrote: > > The Account record has a 'Originating Lead' field but I cannot see how to > convert from the Lead record? Sorry I didn't explain myself properly. See new question 'How to map Lead fields to Account fields. "Chad Fulda" wrote: > I...

Hidden fields in new emails
When I begin to type a new message, the text doesn't appear (the words are hidden) until spell check/sending/or printing. When I select the icon for the font color of text (black) it begins to show my typing as I'm composing the message, but the other words (anything I typed in the 'hidden field') only shows up in the spell check portion and remains hidden. Why are my messages starting with this hidden field and how do I get rid of it? I'm sure I must have pressed some command inadvertently as it was not always working like this. (only been using about a week so s...

Error when no records meet criteria
Hi, I have the following code and receive error 1004 Application defined or object defined error on this line Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _ "=AND(RIGHT(D2)<>""r"",B2=4)" Selection.FormatConditions(3).Interior.ColorIndex = 7 because there are no records in this instance of the report for "4" in ColB. I've searched and applied code all to no avail. Can someone please tell me how to write code for when this may occur in any of the situations below? Range("b2:b800").Select ...

Help with auto height of rows
Hello, I've got Excel 2002. Spreadsheet has over 3400 rows and 6 columns. No merged cells. All fonts are Arial size 10. The first 1809 rows are set to a height of '15.00 (20 pixels)' and the remaining rows are set to '12.75 (17 pixels)'. I've tried selecting all rows and then double clicking on a divider bar to get them all to adjust to auto height, but they stay at the heights listed. I want them all to be at the 12.75 (17 pixels) height when you do the auto height adjustment. Why won't this work on this spreadsheet? Thanks. Mark Nevermind - I fig...

Sorting Issue (Mixde Fields)
I have an issue where I need to sort a worksheet based on a field (Bin Location)that is sorting as seen below... 1A1 1A20 1A21 1A22 1A3 1A4 How can I get Excel to sort it the following way... 1A1 1A3 1A4 1A20 1A21 1A22 Please help.... I need to get this figured out today. I appreciate any responses. Thanks, Jonathan G. One way: add a column showing the length of the column you want to sort, then sort using the new column then the "real" column. "Jonathan G." wrote: > I have an issue where I need to sort a worksheet based on a field (Bin > Location)that is s...

Auto Filling Fields in Current Record from Previous Record
Hello, I have looked through posts related to Auto-Filling a field from a previous record but am still a little unsure of how to do things. What I would like to do is auto fill a field in the current record with one from a different field in a previous record. What I have is a form that records "engine hours" and "tonnes moved" for a piece of equipment. The operator will record the staring hours and tonnes (at the start of a day) and the hours and tonnes at the end of the day. So in the database, I would like the "Starting Hours" and "Starting Tonnes"...

Not saving records till "save" command button clicked
If you are in a form and adding information, then close out or go to a new for it just saves the record as long as all applicable fields are filled out. Is there a way to only have a record save if a command button is clicked? -- Message posted via http://www.accessmonster.com If you simply hide the form instead of closing it, I think that will prevent the save. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "szag via AccessMonster.com" <u2885@uwe> wrote in message news:a75249f4b37bb@uwe... > If you are in a form and adding informat...

More than 100 records in Look Up Records dialog window
Does anybody know, how to get more than 100 records in Look Up Records dialog window? For example in Opportunities - I want to add an existing contact to the opportunity, but I can see only 100 records. I dont want to specify any character, I need to choose from all contacts. (It is not the same problem as paging, PagingLimit in SQL can not help) -- thanks Ivana ...

edit suggest names when completing To, cc and bcc fields
Apparently I don't have an Address Book linked to Outlook 2000. No matter, because I seem to be ok with the suggest names feature, which I guess is not Address Book-linked, but linked to a memory bank of names and corresponding addresses typed in during the past. However, here is my question: How do you edit this Suggest Names list? In particular, A. Suppose you want to stop Outlook from suggesting a particular name because it is not current anymore. Worse, you might inadvertantly click on it and send msg to somebody you don't want to receive it. Is there a way to delet...

Date range in months from month and year fields
In our database we track consultants work dates in four seperate fields, starting month, starting year, ending month, ending year. Is there anyway to calculate the range of months they have worked with this set up? So if someone started March 2004 and ended July 2007 is there a formula to calculate the 40 months they worked? DateDiff("m",[starting month] & "/" & "01" & "/" & [starting year],[ending month] & "/" & "01" & "/" & [ending year]) "monkeycr84" wrote: > In our da...

copy record between tables
Hi, I have two tables with same structure. I need to copy a record from oneto other using vba codes. I'd like avoid to copy field to field.Thank you. Without knowing anything about your table structures, something similar to the following:Dim strSQL As StringstrSQL = "INSERT INTO tblCopy SELECT tblOriginal.* " _ & "FROM tblOriginal WHERE tblOriginal.KeyValue = 4"CurrentProject.Connection.Execute strSQL"Alberto" <saveas[at]iol.it> wrote in message news:uk2oUMBYHHA.3656@TK2MSFTNGP05.phx.gbl...> Hi,> I have two tables with same structure....

Auto Empty Deleted Items on Exit OR after X days or X Items accumulated?
In Outlook 2003 is there a way to Auto Empty the Deleted Items Folder, either on Exit OR after X days since deletion or when X number of Items accumulated? -- "J. J." Go to "Tools" : "Options" : "Other" First option is "Empty Deleted Items folder upon exiting" You can set it to delete after x number of days for certain e-mail account types. Go to: "Tools" : "E-Mail Accounts" : Select, "View or change e-mail accounts" Select account to chnage and click "Change..." : Click "More Settings" Se...

Related Fields in sub activities view
CRM 4.0 In the standard My Activities view I am able to display information from the Account (Regarding) i.e. industry, city etc. When switching to Phone Call or Appointment, the information is not displayed even though the facility is there in admin to add these fields - is there a fix for this? ...

Record data on two lines
Sorry about repeating the post but I think I messed up the first one yeaterday! I am receiving a spreadsheet from an agency with record information on two lines. Example: Record 1: A1, B1, C1, D1, A2, B2, C2 Line 3 blank Record 2: A4, B4, C4, D4, A5, B5, C5 There are over 100 records like this. They claim they can't fix it... It originates from a Crystal Report. How can I change the data so each record is on one line: Record 1: A1, B1, C1, D1, E1, F1, G1 Record 2: A2, B2, .......................G2 Thanks for any help! Dan A simple way is to 1) select all of the data fields. 2) Cli...

opening files created on previous versions
I am trying to open a file created in pub95 version5.0 with pub98. Response- cannot open files created on previous versions. Is there a way around this? Thanks Hi Lloyd (anonymous@discussions.microsoft.com), in the newsgroups you posted: || I am trying to open a file created in pub95 version5.0 with pub98. || Response- cannot open files created on previous versions. Is there a || way around this? Thanks How do you know what the previous version was? FWIW, Publisher 95 (Actually called Publisher for Windows 95) is version 3.0. Version 5.0 is version 98. -- Brian Kvalheim Microsoft Publis...

Parse field in query
I have a table called MasterData with a field called Originator. The field data looks like this... Lou Santana Steven Sentry/Miami/PU/WC/US CN=Kathy T. Buon/OU=Miami/OU=BU/O=WC/C=US Terry J Leif I need it to look like this... Lou Santana Steven Sentry Kathy T. Buon Terry J Leif How can this be parsed?? -- deb What a mess that you're stuck with! Below will look for the first / and return the string before it in a query. If there isn't a / it returns the entire string. Of course this doesn't help with the CN= in CN=Kathy T. Buon. Parsed: IIf(InStr([Originator],"/")...

Show related records for custom entity
I have a custom entity. When I go to History I can not see the related records from contacts, opportunities, etc. They are not rolling up and there is no pick list to show related records or not. Is there a way to change this? Thanks, -Rick M On Fri, 23 Feb 2007 10:33:49 -0800, Rick M <RickM@discussions.microsoft.com> wrote: >I have a custom entity. When I go to History I can not see the related >records from contacts, opportunities, etc. They are not rolling up and there >is no pick list to show related records or not. Is there a way to change >this? > As...

Creating a warning prior to deleting a record
I'm creating a membership database for an organisation. A problem I've encountered is the young lady that will be using the completed database is occasionally using control/z to undo an input error too frequently and deletes the record that she is inputting. As the membership number is an auto-number field this loses that particular membership number which I need to stop from happening. Is there anyway I can generate a warning prior to that final deletion to stop this from occurring? TIA BigAl Autonumber is not recommended for the use you describe, for exactly the reason you...

Auto delete stopped functioning in Outlook 2000
Hi, I have a single install on a user PC which although the option to auto empty the waste bin is checked it is not deleting or even asking whether she is sure she wants to delete. Advice appreciated, Sam ...

Auto copy emails btw 2 mailboxs
Hi All, I have 2 email accts A , B. 1)What ever sent to acct A will auto copy to Inbox B. 2)What ever sent from acct A will auto copy to Sent Items Box B. How do I define this email rule in MS exchange server? Thanks & Regards, Steve 1) In AD Users and Computers, select the profile properties, go to the Exchange General tab and select Delivery Options - here you can specify mailbox B to get a copy. 2) not sure if this is possible. S. <foozhiqin@gmail.com> wrote in message news:1116902957.014076.300440@g44g2000cwa.googlegroups.com... > Hi All, > > I have 2 email...

Allowing rules for auto-forwarding mails over OWA
Hey guys! I want to allow OWA-users to make a rule, which auto-forwards mails. But the users always got an error and the message to try it again in a few minutes. Facts: - it doesn´t mather if the recipient is an domain-user or not - users can create such a rule over desktop-outlook, but not over owa - users can create all rules except auto-forwarding! - Exchange version: 2003 sp1 And the error message is ... ? dOcToR bEaT wrote: > Hey guys! > > I want to allow OWA-users to make a rule, which auto-forwards mails. > But the users alway...

Need help getting query to reference a field in a subform
I am trying to run a query using a specific field in a subform as the criteria. The query is displaying one combo box from the Form, as well as several fields from its own subform. My Form name is: FormGrantManagement My Subform name is: TableMOA subform My Subform's subform is: TableCostReports The field in the subform I want to reference is: MOAID I have found other help topics that lead me to think that a criteria along the lines of [Forms]![FormGrantManagement]![TableMOA subform]! [Form]![MOAID] is what I need to use, and I have tried multiple variations of this but witho...

Access to Excel: Identify attachment field in access database
Hi All, How do I query a database field of type attachment? For eg: I have a database field of type attachment and I want to run a query in excel that identifies columns with no attachments and some other criterias and populates it. here is the query I have so far: If rst.fields("7") Is Null and rst.fields("5") = "Chicago" Then Me.File.Value = "NO" End If Hope I made it clear Thanks in advance You have two choices. 1) Use a SQL statement that gets only the records that meet your requirements by filtering the Da...

How do I retrieve a previous version of file?
I have just overwritten the only version of a 2MB file with a blank spreadsheet? Can I retrieve the original *.xls file? No. Sorry. Not without using some super-fancy schmancy recovery software that usually costs a bundle. ******************* ~Anne Troy www.piersontech.com www.mrexcel.com "Urospin" <Urospin@discussions.microsoft.com> wrote in message news:D5C27EB9-20F3-4CC7-BF6C-7ECC279DBDD9@microsoft.com... > I have just overwritten the only version of a 2MB file with a blank > spreadsheet? Can I retrieve the original *.xls file? What fancy software is available ...

4.0 Workflow
I am trying to setup a workflow to send an email when an Account record gets deleted. I want to include the name of the Company in the email and who deleted it. The workflow fires, but always has a Status of Waiting because it says "The requested record was not found or you do not have sufficient permissions to view it". The reason this happens, I am assuming, is that the record has already been deleted so data from the record cannot be included in the email. Is there a way I can accomplish what I want? Workflow plugins are asynchronous so by the time you get to the databas...