Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2003
    Location
    Grass Valley, California, USA
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Text Control Update (Access 2000 Premium)

    I have an unbound Text Control on a main form. My user may either type in a value, or invoke a subscreen to perform a lookup operation for the relevant value to be placed into the main form text field. I have supplied a button on the subform which may be depressed with the subsequent action of placing the "found" code value back into the main form's Text Control. When I test this feature, any prior visible value in the Text Control remains visible as the prior value. However, if I then reposition the record of the main form, and then reposition back to the main form record in which I had attempted to insert this new found value, I find that it has changed to the new value.

    My question is how can I get the visible value to change to the newly inserted value by use of VBA code associated with the subscreen button, without doing the record juggling act in the main screen?

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Text Control Update (Access 2000 Premium)

    Something like repaint, requery, or recalc? I always get them confused....

    Cecilia :-)

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Text Control Update (Access 2000 Premium)

    All you need to do to update the value of an ubound textbox is

    Text1.Value = "Some New Value"

    No requerying or refreshing should be necessary.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  4. #4
    Star Lounger
    Join Date
    Jan 2003
    Location
    Grass Valley, California, USA
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Text Control Update (Access 2000 Premium)

    Cecilla -- Thanks for the "refresh". <g> I had already tried "repaint" without success, as well as "requery". But the "FormName.Refresh" did the trick.
    -- Jim

Posting Permissions

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