Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Instant Refresh of current record (A2K)

    Scenario:
    I have a combo box (cboTab01_F02_UserId) which is visible at all times.
    I have a text box (txtTab01_F02_User) adjacent to it.

    Prior to selection of the user id (cboTab01_F02_UserId), the text box (txtTab01_F02_User) is not visible based on the following code:

    Private Sub Form_Current()
    If Me.cboTab01_F02_UserId > 0 Then
    Me!txtTab01_F02_User.Visible = True
    Else
    Me!txtTab01_F02_User.Visible = False
    End If
    End Sub

    When I select a UserId, the following code is used:

    Private Sub cboTab01_F02_UserId_AfterUpdate()
    Me.txtTab03_txtStartHere.SetFocus
    End Sub

    This takes me to a specific field (txtTab03_txtStartHere) on another tabbed page which is exactly what I want.

    Problem:

    When I go back to the original page, Tab01, the user name text box (txtTab01_F02_User) is NOT visible.
    The only way it becomes visible is if I close the form and return.
    I've tried Me.Refresh and this does not do the job. Using Me.Requery puts me back on the first record and not the current record that I'm working on.

    I'd appreciate any help in showing me the error of my ( programming ) ways.
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Instant Refresh of current record (A2K)

    Make the text box txtTab01_F02_User visible in the After Update event of the combo box cboTab01_F02_UserId:

    Private Sub cboTab01_F02_UserId_AfterUpdate()
    Me.txtTab01_F02_User.Visible = (Me.cboTab01_F02_UserId > 0)
    Me.txtTab03_txtStartHere.SetFocus
    End Sub

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Instant Refresh of current record (A2K)

    Hans,

    Marvelous start for the New Year with respect to Access work. Your answer was bang on. I hope that the other folks watching get as much out of your answers as I. Thanks again,
    Cheers,
    Andy

Posting Permissions

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