Results 1 to 6 of 6

Thread: ACCESS (2000)

  1. #1
    New Lounger
    Join Date
    Aug 2001
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ACCESS (2000)

    I have a form that is a personnel roster. One of the things that the form identifies is the job title. The control that lists the job titles is a combo box. Some of the job titles are management positions. When the management positions are selected, I want a few controls to become visible. When the non-managment positions are selected for these controls NOT to be visible. I used a SELECT statement on the After Update Event of the job title combo box that contains all the job titles and it works perfectly fine.
    HERE's WHAT DOESN'T WORK:
    When I just flip through the records, nothing changes. I put the same SELECT statement on the Event OnLoad. I suspect that's not correct. I want the form to dispaly properly without having to make any updates on it. so that if I were just flipping through the records to verify information, i would be able to see the right information.

  2. #2
    2 Star Lounger
    Join Date
    May 2002
    Location
    USA
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ACCESS (2000)

    This kind of sounds like you'll want to put that code in the AfterUpdate event of the Form rather than the AfterUpdate of the combo box. With it in the area of the combo box you'll have to tab out of that all the time for the code to work. That is the only thing I can think of. I am sure someone else might have a better idea.

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ACCESS (2000)

    I suppose that you have a field in the position table that indicate if the position is management or not.
    Add this field to the combobox rowsource.
    Set the visible property of the textboxes that you want to hide to No.
    In the On Current event of the form enter something like this:
    <pre>If Me.cmbPosition.Column(2) = "xxx" then
    ' replace the xxx with what you have in the position table for managers
    Me.HidedTextbox.Visible = True
    Else
    Me.HidefTextbox.Visible = False
    End If</pre>

    Column(2) : I set 2, supposing you have an ID, a description and then the new field. Columns begin to tell with 0.
    If you don't have an ID then it would be the second column, enter 1
    If you don't want the manager column to be displayed set his width to 0

    To be complete, you should call the code from the afterupdate of the combo.
    In the after update of the combo, enter :
    <pre>Private Sub NAAM_AfterUpdate()
    Form_Current
    End Sub</pre>

    Francois

  4. #4
    New Lounger
    Join Date
    Aug 2001
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ACCESS (2000)

    A little more info:
    As I flip through the records and the job titles change the controls don't appear and disappear like they should. If I change the control (triggering the after update for the control) it of course works! I want it to display or not dispaly when I flip through the records.

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ACCESS (2000)

    Did you put the code in the on current event of the form ?
    Francois

  6. #6
    New Lounger
    Join Date
    Aug 2001
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ACCESS (2000)

    You are BRILLIANT! It is now working perfectly! Obviously I don't understand Form events very well and I knew that going into it, but I thought I could get it. I would never have tried ON Current. so thank you for the info!

Posting Permissions

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