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

    Unanswered: repeating values

    hello i have a question. i know its probable an easy fix , but not east to a noob like me.. i created a field from my mainID named"pickupname" i also made a form. in my form that field, and a addnew record button is the only thing there.(more will be added later) i want to be able to add a value in that field , press addnew record and that field value show up on the next record automatically . here is what i have that is not working. i selected my pickupname field and in the control source i typed DLookup("mainID", "pickupname", "mainID = " & Forms![pickupname]!mainID)

  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.

    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

    still not doing it for me

    this is what i used.. Private Sub PICKUPNAME_AfterUpdate()
    Me.PICKUPNAME.DefaultValue = """" & Me.PICKUPNAME.Value & """"
    End Sub. my control source is pickupname

Posting Permissions

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