• Setting a Variable (Access 2002)

    Author
    Topic
    #401541

    This is probably one of those that I should know off the top of my head-

    I have a table whose PK is an autonum that just counts up. I need to be able to set a variable to the highest number in this field. I’ve tried several different ways, but keep brickwall .

    I’ve written a make-table query to keep a one-record, one-row table up to date, bit can’t figure out how to set a variable equal to it.

    TMI Warning==> AND in case I’m just going about this ALL WRONG, here’s what I’m trying to accomplish: I have a form that lists item numbers based on a selection from a combobox. I’m adding functionality to add another choice to the combobox. Accomplished that without problems. But I want the form to automatically show the items from the newly created choice. (Yes, it will be blank, but that’s OK).

    Viewing 1 reply thread
    Author
    Replies
    • #791596

      DMax(“PK_Name”, “Table_Name”) will return the maximum value of the field named PK_Name in the table named Table_Name.

    • #791597

      DMax(“PK_Name”, “Table_Name”) will return the maximum value of the field named PK_Name in the table named Table_Name.

    Viewing 1 reply thread
    Reply To: Setting a Variable (Access 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: