Results 1 to 13 of 13
  1. #1
    humpz is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    13

    Question fill like previous and increment in text box


    hi all,

    i have question at form,,can access make textbox like previous record until i fill another input?so if i am not fill another input the text inbox in new record same as data in previous record?

    and another question is can i make textbox as number increment automatically in new record,,example if i input number "1" at new record textbox automatic fill "2",then "3" until i input another random number.

    thanks for your attention

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  3. #3
    humpz is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    13

    still confused

    i try that program but it can't work,,it say error
    can you help me to edit in my form?
    i follow my form in attachment
    in drawing number area i want it can increase number automatically until i input another number
    and in the other i want this input same like previous,,can you help me to solve my problem?
    thank you very much for your kindness

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In the code you added, you need to replace Control with the name of the control you want the value to carry over.

  5. #5
    humpz is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    13
    its still same,,what the problem?
    do you mean that i must replaced command name or i must replaced with another one?
    i have tried to change with command name but its still same,,say "run time error"

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    This would carry over the Text34 control:
    Code:
       Const cQuote = ""
       Me.Text34.DefaultValue = cQuote & Me.Text34.Value & cQuote

  7. #7
    humpz is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    13
    finally it work,,
    thank you very much ruralguy

  8. #8
    humpz is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    13
    ohh,once again
    can i make textbox that the value always increase 1 in new record??

    i get from another source like this code

    Private Sub intDrawing_AfterUpdate()
    If Not IsNull(Me.intDrawing.Value) Then
    intDrawing.DefaultValue = Me.intDrawing.Value + 1
    End If
    End Sub

    but it only increase once when i make a new record,,not every time i make a new record,,so what the problem??

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Instead of the AfterUpdate event of the control, put the same code in the BeforeUpdate event of the Form.

  10. #10
    humpz is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    13
    sorry,, i am beginner in access,,can you tell me where the after update of the form?
    or did you mean that i must input in my control again? i do but it didn't work
    thanks for your teaching to me rural guy

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Open your form in design mode and press <ATL> F11 then paste this code into the code module for the form.
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
       If Not IsNull(Me.intDrawing.Value) Then
          intDrawing.DefaultValue = Me.intDrawing.Value + 1
       End If
    End Sub

  12. #12
    humpz is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    13
    finally its work nicely
    thank you so much for your attention rural guy

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're welcome.

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

Similar Threads

  1. using value from previous record
    By dollars in forum Queries
    Replies: 0
    Last Post: 12-10-2008, 03:30 PM
  2. Fill in Null values
    By Petefured in forum Queries
    Replies: 1
    Last Post: 10-06-2008, 12:54 PM
  3. Previous value
    By yegnal in forum Forms
    Replies: 0
    Last Post: 07-22-2007, 07:51 AM
  4. Auto-increment for non-100% numerical fields
    By supernoob in forum Access
    Replies: 0
    Last Post: 05-03-2007, 09:44 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