Synchronized Combo Boxes.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Rachel (Rachel_at_discussions.microsoft.com)
Date: 01/17/05


Date: Mon, 17 Jan 2005 10:41:08 -0800

I have 2 synchronized combo boxes - one with the TRNG_CODE and the other with
the various descriptions for classes under each TRNG_CODE. Everything works
great except that if I have multiple descriptions for one code, it will only
let me choose the first description. All of the multiple descriptions
display in the combo box when the TRNG_CODE is chosen...but it will not let
me choose anything else but the first one displayed.

The code for the TRNG_CODE combo (cboFind) is below with the row source
being a value list I typed.

Private Sub cboFind_AfterUpdate()
    cboFound.Requery
    cboFound.SetFocus
End Sub

The other combo box's code is below with the row source being a query
containg the TRNG_CODE and TRNG_DESC with the TRNG_CODE criteria being: Like
[Forms]![TRAINING INPUT TEST2]![cboFind].

Private Sub cboFound_AfterUpdate()
    Me.Painting = False
    DoCmd.GoToRecord , , acFirst
    Do Until Me!TRNG_CODE = Me!cboFound
        DoCmd.GoToRecord , , acNext
        If Me.Recordset.EOF Then Exit Sub
    Loop
    Me.Painting = True
End Sub

Hope this is enough info for a response...please help! :)

Thanks,
Rachel



Relevant Pages

  • Re: Printing the Form
    ... Private Sub Command1_Click ... The problem with parts of your drawing failing to print is probably because your PictureBoxes are not Autoredraw, but the PrintForm method also has various other problems printing the contents or background of containers, especially if they are themselves contained in other containers. ... There are many ways of doing this, depending on whether the Form you wish to print is fully visible on the display at the time you want to print it, or whether you wish to print a Form that is not fully visible on the display, and in some cases depending on whether you wish the code to work on versions of Windows prioer to XP. ...
    (microsoft.public.vb.general.discussion)
  • RE: From Help
    ... To see how my approach works, create a new document called Test1. ... This will create a user form named UserForm1. ... Private Sub CommandButton1_Click ... This should display the code for the Document_New ...
    (microsoft.public.word.vba.general)
  • Re: Combo Box text display problem based on AfterUpdate...
    ... Private Sub Form_Current ... The cboStore and cboEmployee display fine. ... "Ken Snell " wrote: ... <MS ACCESS MVP> ...
    (microsoft.public.access.forms)
  • Re: Trouble displaying info from access db
    ... set Label Value ... not getting the Subject Code to display in the Label? ... Private Sub Form1_Load(ByVal sender As System.Object, ... Dim intRecordCount As Integer ...
    (microsoft.public.dotnet.languages.vb)
  • Re: triangular array- how to transform twodimensional array into singledimesional array
    ... Dim intCount As Integer ... Private Sub CommandX_Click ... display) what is, for example, group 5, what pair make this group. ...
    (comp.lang.basic.visual.misc)