Results 1 to 4 of 4
  1. #1
    Join Date
    May 2013
    Posts
    27

    Unanswered: duplicating fields

    hello everyone.. im stuck with a problem that is probably easy to fix, but not for a noob like me.

    i have a table(mainID) with fields
    pickupname
    pickupaddress
    pickupphone
    ive created a form based on that table....what i want to do is after i enter the value to those fields, i want access to remember those values in the next record, and only change them if i choose to..
    this is what i enterd in the default properties and it didnt work...=DLast("pickupname","main"). can someone help me.. please

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    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.

    Code:
    Private Sub YourControlName_AfterUpdate()
       Me.YourControlName.DefaultValue = """" & Me.YourControlName.Value & """"
    End Sub

    which is valid for Text, Number, DateTime and Boolean Datatypes.

    You’ll need to do this for each Control that you want to ‘carry forward

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    May 2013
    Posts
    27

    un-successful

    this is what ive done... in the after update of my dropoffname field i entered:

    Private Sub DROPOFFNAME_AfterUpdate()
    Me.DROPOFFNAME.DefaultValue = """" & Me.DROPOFFNAME.Value & """"
    End Sub
    still nothing . when i select save and add new record field show up blank..

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    This is standard code that is time tested! Does any VBA code run? To allow Code to run in 2007/2010/2013 you need to declare the Folder as 'Trusted.'

    To trust your folder, click:

    1. Office Button (top left)
    2. Access Options (bottom of dialog)
    3. Trust Center (left)
    4. Trust Center Settings (button) on far right
    5. Trusted Locations (left)
    6. Add new location (button)
    7. Enter Folder Name
    8. Click on Okay

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •