Consulting

Results 1 to 3 of 3

Thread: vlookup in Vba + preventing tabulations in a form field

  1. #1

    vlookup in Vba + preventing tabulations in a form field

    hi,

    posted my pb on another board but seems people are loosing interest (even though I believe the solution is quite easy )

    I need to use Vlookups extensively in my project and it seems to be a problem for me to get it to work...

    in the following code: tb_Valoren is a Textbox that the user has to fill up in a form. when the user submits the form I need to get the currency for this valoren.

    if i hard code an existing valoren in the following code the function works...

    [VBA]wsTrades.Cells(Pointer, 6) = Application.WorksheetFunction.VLookup("& tb_Valoren.Value &", [db_SecValoren], 6, False)[/VBA]


    the valoren can be either numeric or in this form : 123456789.abc123

    hope someone can help me out there

    thanks!


    ps: is it possible to prevent the user from using the tabulation (Tab) in a form field?

    thanks!
    Last edited by choubix; 07-17-2008 at 01:31 AM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    So what is wrong with the solution that I gave you here
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    managed to get the vlookup to work using the array in which the data was stored...


    still I have a problem:
    the user fills up TextboxA, is it possible to update Textbox B automatically? (without the user having to click anything)

    I am using a Vlookup this way:

    tb_Valoren.Value = ActiveCell
    tb_BbrgCode = Application.WorksheetFunction.VLookup(tb_Valoren.Value, [db_SecValoren], 5, False)

    it works only if the user has activated the cell on the worksheet. not when the user fills in the textbox tb_Valoren

    any idea?

    is it possible to prevent the user from using the Tab key inside a textbox??

    thanks!

Posting Permissions

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