Results 1 to 7 of 7
  1. #1
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178

    Unanswered: Make Corrections Visible On Screen

    Hi,

    I'm displaying a 7-field record in appropriate text boxes, and underneath, another 7 text boxes to make any changes (the original record text boxes are locked). After updating the original record with VBA, I want the changes to show immediately in the "original" text boxes. How do I do that?

    I don't want to close the screen after updating.

    Thanks,
    Sam

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    refresh the data, or consider placing some code in the forms afterupdate event to populate the controls with the reequired data.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Quote Originally Posted by healdem
    refresh the data, or consider placing some code in the forms afterupdate event to populate the controls with the reequired data.
    1-How do I refresh the data?
    2-What kind of code in AfterUpdate will update the controls' information?

    Thanks,
    Sam

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i probably can't help cos i do things a strange way.
    to get help you should probably explain where the form gets the data in the first place. a "stupid" answer to your question is repeat whatever you did to get the original data there.


    for me in DAO is goes like this: my edit forms are unbound single-record forms fed from a one-record-recordset. (filling the form in the first place and refilling it with updated data are identical):

    dim rst as DAO.recordset
    dim fld as DAO.field
    dim strSQL as string
    strSQL = "SELECT a, b, c, d, e, f, g FROM tblX WHERE pk = " & thePK & ";"
    set rst = currentdb.openrecordset(strSQL)
    for each fld in rst.fields
    '
    'next line assumes your lockedboxes have the same name as the field
    'if not, could fix with SELECT a AS aBoxName etc in strSQL or
    'something like me("blah" & fld.name)
    '
    me(fld.name) = fld
    next
    set fld = nothing
    rst.close
    set rst = nothing

    bound form, multi-record-form ...will need different approaches

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    May 2005
    Posts
    150
    yea I've been working with what Izy is talking about and I am finding that that is the best way to control how information gets entered and how you display it.

    For a lot of the repetitious stuff you can create functions that will always bring up the information you need. Also you can run the neccessary queries during backend processes to give the appearance that the system is running quicker.

  6. #6
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Hi, Izyrider,

    and thanks. I hadn't thought of using an unbound form. The amazing ideas that come through on these forums!

    Your other points are well taken also.

    I will implement your idea, and if and when I have problems with the next step, I'll just create a new thread.

    Thanks again,
    Sam

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Sam,

    In general: (re: Izy's idea) MyUnboundTextForm.Value=MyOtherUnboundTextBox.Valu e

    I do this myself too ... Except I use ADO
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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