Results 1 to 5 of 5
  1. #1
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97

    troubles with autonumber within macro argument

    I'm trying to incorporate a macro within the AfterUpdate event of a combobox which should autofill the field :

    ACTION Search Record
    ARGUMENTS ; ; First; ="[ID] = " & Int(Nz([Screen].[ActiveControl];0))

    ...but this doesn't work
    Actually [ID] is an autonumber field, so I am not sure Str is right.... but I don't know syntax alternatives..
    Last edited by focosi; 08-11-2011 at 09:32 AM.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    what are you trying to accomplish?

    Are you just trying to retrieve the most recent ID before the record is actually appended to your table? Basically the next valid autonumber field?

  3. #3
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    No, rpeare, mine is a macro incorporated within the afterupdate event of an unbound combobox.
    It works at autocompleting ID in the control according to the first digits that are entered, suggesting entries based on records already found in that field.
    This works like a charm when the field to autocomplete is a text field, but ID is an autonumber... and the macro doesn't work as it is

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you can probably use the cstr/clng (change to string/change to long integer) to do your checking if it's an issue between alpha/numeric. So your input search would be text, and if it's a combo box for instance you'd have the ID as the bound column and the display column set to cstr(ID)

  5. #5
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    can't understand how to do what you suggest...

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

Similar Threads

  1. FindFirst with multiple fields in criteria
    By compooper in forum Programming
    Replies: 5
    Last Post: 07-22-2011, 10:29 AM
  2. Replies: 1
    Last Post: 04-19-2011, 04:46 PM
  3. Replies: 3
    Last Post: 03-21-2011, 05:29 PM
  4. ComboBox with multiple columns
    By rkm360 in forum Forms
    Replies: 10
    Last Post: 05-14-2010, 01:19 PM
  5. Combo Box with multiple columns
    By desireemm1 in forum Access
    Replies: 1
    Last Post: 08-17-2009, 02:36 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