Results 1 to 3 of 3
  1. #1
    krefael is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    1

    Default value previous record & calculated control from different query

    Hello,
    Thanks for the help in this forum.
    I have 2 problems to solve, please help me.

    1. I try to set the default value of a control in a form to get the data from the last record enterd in the table. Looking fo simple way.

    2. I have query that calculte the sum according to what I choose in the form ("query1" - have only one line). I want a control to show me the value of this query.

    (Using Access 2010)


    Thanks,
    krefael

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    1. Review
    http://allenbrowne.com/ser-24.html
    http://support.microsoft.com/kb/210236
    http://support.microsoft.com/kb/210504

    2. Options
    a. DLookup expression in textbox
    b. Listbox RowSource set to the query
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    In #1, if you're speaking of
    • Opening Access
    • Entering a series of Records
    • Have a Field Default to the Value entered in the previous Record

    the simple way would be to 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.

    Code:
    Private Sub YourControlName_AfterUpdate()
       Me.YourControlName.DefaultValue = """" & Me.YourControlName.Value & """"
    End Sub
    Note that this code/syntax can be used for any Datatype.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Default Calculated Date Value
    By HMEpartsmanager in forum Forms
    Replies: 17
    Last Post: 09-12-2012, 08:37 AM
  2. Using calculated value from previous register
    By eduardo10 in forum Access
    Replies: 2
    Last Post: 08-19-2011, 12:09 PM
  3. Replies: 4
    Last Post: 10-01-2010, 12:06 PM
  4. Replies: 4
    Last Post: 01-27-2010, 12:39 PM
  5. Replies: 1
    Last Post: 02-10-2007, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums