Results 1 to 5 of 5
  1. #1
    sajlen1414 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    2

    Auto fill from previous cell

    Simply.
    It looks like this:
    Click image for larger version. 

Name:	1.jpg 
Views:	6 
Size:	15.3 KB 
ID:	11871


    Short no and Example are static auto fill (10 and 1503 are the most common so they auto fill)
    But Long no cant be auto filled like that. As you can see Long no has to be somethimes copied and pasted which is problematic.
    My idea is for New record to auto fill from last known record. In this example autofill Long no from record 6 with 986656551.
    Like this:
    Click image for larger version. 

Name:	2.jpg 
Views:	4 
Size:	16.2 KB 
ID:	11872
    Obviously if there were other no in record 6 auto fill should look differently.
    I hope I made myself clear.

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    One method is to set the DefaultValue property of LongNo. In LongNo textbox BeforeUpdate event VBA procedure:

    Me.LongNo.DefaultValue = Me.LongNo

    However, setting the value in new record when the form first opens is a different issue and more complicated. Do you need this behavior?


    I am curious, never seen (Newy) in new record row, always (New). Do you know why it shows a 'y'?


    Advise no spaces or special characters/punctuation (underscore is exception) in names. Better would be LongNo or Long_No.
    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.

  4. #4
    sajlen1414 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    2
    Unfortunately I am not so advanced in acces (wich is why I asked for help in the first place) and therefore even though your answet gave me 2 hours in front of my PC trying to do something I did nothing. If you could say what to do like to a 10Yo I would be glad.

    P.S.
    It's not Newy
    It's Nowy
    I am from poland and Nowy(PL) = New(ENG)

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try:

    1. form in design view

    2. select the textbox for the value you want to repeat

    3. on the Properties dialog Event tab, BeforeUpdate event, select [Event Procedure]

    4. click the ellipses (...), this will open the VBA editor in the procedure

    5. type code: Me[.Long No].DefaultValue = Me.[Long No]

    6. save form
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 09-26-2012, 04:22 AM
  2. Replies: 9
    Last Post: 03-16-2012, 01:03 PM
  3. Replies: 1
    Last Post: 12-21-2011, 02:11 PM
  4. Replies: 3
    Last Post: 02-02-2011, 08:04 PM
  5. Replies: 12
    Last Post: 08-09-2009, 07:35 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