Results 1 to 8 of 8
  1. #1
    franknyt is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2019
    Posts
    4

    Combobox Works for me but Client hates it... dlookup won't sort so I'm screwed

    I have form with a datasheet embeded.


    Have a combobox that autopopulates text field. Yay!

    BUT :(

    Client does not like nor want a combobox, prefers free text typing (combobox while typing trys to auto-fill, causing frustration and mistakes).


    Dlookup won't work because the autopopluted field needs to be sortable. dlookup fields won't allow you to sort.


    e.g. Type "N1" on textField and updates other field to "25," and that field ("25") column is sortable: A-Z or Z-A.

    Thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You can place a value in the second textbox in the after update event of the first:

    Me.SecondTextbox = DLookup(...)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    franknyt is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2019
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    You can place a value in the second textbox in the after update event of the first:

    Me.SecondTextbox = DLookup(...)
    OH! I'll try that, thanks!!!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problem, post back if you get stuck. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    franknyt is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2019
    Posts
    4
    Hey pbaldy,

    I couldn't get it to work. I believe I got the syntax right but I don't think I placed it in the right place and triggered right.

    I'm placing it on V12 Validates text field onChange


    Me.V12_Ranking = DLookup("Ranking", "Validation_Codes", "validation_code=" & [V12 Validates])


    The two fields in datasheet are:

    "V12 Validates," text field where the code is entered.
    The second field is what needs to update, "V12_Ranking." This field needs to be sortable in datasheet view.

    The table "Ranking" is being looked up in is:

    "Validation_Codes"

    Field Names In Validates_Codes table:
    validation_code
    Ranking

    Thanks, and sorry for the rainbow.

    -Frank

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Try the after update event; the change event requires you to use the .Text property, but also fires on every keystroke which typically isn't desired. Also if the code is text it requires delimiters:

    http://theaccessweb.com/general/gen0018.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    franknyt is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2019
    Posts
    4

    You rock!

    Quote Originally Posted by pbaldy View Post
    Try the after update event; the change event requires you to use the .Text property, but also fires on every keystroke which typically isn't desired. Also if the code is text it requires delimiters:

    http://theaccessweb.com/general/gen0018.htm

    At first I was "OH!," then I was like "wtf," but then I was like "HOLY SHIT, IT WORKED!"

    THANK YOU SO MUCH! You really helped. I truly appreciate it, pbaldy.

    -Frank

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Lol! Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. This works sort of
    By Lou_Reed in forum Access
    Replies: 5
    Last Post: 04-06-2017, 12:07 PM
  2. Replies: 27
    Last Post: 12-13-2016, 11:08 AM
  3. Dlookup Works in Controlsource - but not in VBA
    By crimedog in forum Programming
    Replies: 13
    Last Post: 11-20-2015, 10:55 AM
  4. Is this how a combobox works?
    By crobaseball in forum Access
    Replies: 3
    Last Post: 04-09-2014, 12:49 AM
  5. Syntax mistake? or Access hates me?
    By axess_nab in forum Forms
    Replies: 14
    Last Post: 05-19-2011, 10:54 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