Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Feb 2010
    Denver, CO
    Thanked 0 Times in 0 Posts

    Setting a Variable (Access 2002)

    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 <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15> .

    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.

    <font color=red>TMI Warning==></font color=red> 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).

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Setting a Variable (Access 2002)

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

Posting Permissions

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