Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

List Box

Discussion in 'Information Technology' started by Lin Light, Jul 28, 2006.

Tags:
  1. Lin Light

    Lin Light
    Expand Collapse
    Guest

    I created a List Box and it does what I want
    --BUT-- Once I enter in the PO# and the
    Vendor and PO# for that record populates the form as soon as I
    TAB, the NEXT PO# now appears in the PO# box. SO I enter
    PO#6093 -- Baker/Taylor appears in the Vendor Box and
    6093 appears in the PO Box -- BUT as soon as I hit TAB or any KEY
    that Information changes to the next record???????

    This is what appears in AfterUpDate for a List Box I created
    under the Combo Box Wizard. I chose enter inform for record
    on form (third Option)
    Private Sub Combo4_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[PONumber] = " & Str(Me![Combo4])
    Me.Bookmark = rs.Bookmark
    End Sub
    --
    Lin Light Herrick District Library
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News How The Left & Indian Nationalists Distorted The History Of Sikh Gadhar Movement - Breaking News Sep 21, 2016
    Interfaith Materialists And Its Discontents Interfaith Dialogues Jun 10, 2016
    Sikhi Quasi-Pragmatists And Quasi-Spiritualists, Care To Explain? Sikh Sikhi Sikhism Jun 6, 2016
    Cholesterol Is Finally Officially Removed From "naughty List" Health & Nutrition Feb 11, 2016
    Listening to Gurbani while driving?? Sikh Rehat Maryada Jan 13, 2016

  3. strive4peace

    strive4peace
    Expand Collapse
    Guest

    My guess is that the ListBox is the last control you created
    and is, therefore, the last control on the tab order. When
    you press TAB in the last field of a record, Access goes to
    the next record...

    You can do this:

    Form properties -->
    Other tab -->
    Cycle --> Current Record
    (instead of All Records)

    you can also change the TAB order of your controls

    right-click in the detail (or appropriate) section and
    choose Tab Order... from the shortcut menu

    Warm Regards,
    Crystal
    MVP Microsoft Access

    remote programming and training
    strive4peace2006 at yahoo.com
    *
    Have an awesome day ;)


    Lin Light wrote:
    > I created a List Box and it does what I want
    > --BUT-- Once I enter in the PO# and the
    > Vendor and PO# for that record populates the form as soon as I
    > TAB, the NEXT PO# now appears in the PO# box. SO I enter
    > PO#6093 -- Baker/Taylor appears in the Vendor Box and
    > 6093 appears in the PO Box -- BUT as soon as I hit TAB or any KEY
    > that Information changes to the next record???????
    >
    > This is what appears in AfterUpDate for a List Box I created
    > under the Combo Box Wizard. I chose enter inform for record
    > on form (third Option)
    > Private Sub Combo4_AfterUpdate()
    > ' Find the record that matches the control.
    > Dim rs As Object
    >
    > Set rs = Me.Recordset.Clone
    > rs.FindFirst "[PONumber] = " & Str(Me![Combo4])
    > Me.Bookmark = rs.Bookmark
    > End Sub
     
  4. Lin Light

    Lin Light
    Expand Collapse
    Guest

    That worked. Could you look at my other question, seeing how you
    solved this one.
    --
    Lin Light Herrick District Library


    "strive4peace" wrote:

    > My guess is that the ListBox is the last control you created
    > and is, therefore, the last control on the tab order. When
    > you press TAB in the last field of a record, Access goes to
    > the next record...
    >
    > You can do this:
    >
    > Form properties -->
    > Other tab -->
    > Cycle --> Current Record
    > (instead of All Records)
    >
    > you can also change the TAB order of your controls
    >
    > right-click in the detail (or appropriate) section and
    > choose Tab Order... from the shortcut menu
    >
    > Warm Regards,
    > Crystal
    > MVP Microsoft Access
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    > *
    > Have an awesome day ;)
    >
    >
    > Lin Light wrote:
    > > I created a List Box and it does what I want
    > > --BUT-- Once I enter in the PO# and the
    > > Vendor and PO# for that record populates the form as soon as I
    > > TAB, the NEXT PO# now appears in the PO# box. SO I enter
    > > PO#6093 -- Baker/Taylor appears in the Vendor Box and
    > > 6093 appears in the PO Box -- BUT as soon as I hit TAB or any KEY
    > > that Information changes to the next record???????
    > >
    > > This is what appears in AfterUpDate for a List Box I created
    > > under the Combo Box Wizard. I chose enter inform for record
    > > on form (third Option)
    > > Private Sub Combo4_AfterUpdate()
    > > ' Find the record that matches the control.
    > > Dim rs As Object
    > >
    > > Set rs = Me.Recordset.Clone
    > > rs.FindFirst "[PONumber] = " & Str(Me![Combo4])
    > > Me.Bookmark = rs.Bookmark
    > > End Sub

    >
     
  5. strive4peace

    strive4peace
    Expand Collapse
    Guest

    you're welcome, Lin ;) happy to help

    as for you other question... perhaps you are asking for a
    bit much ... I do not have a template for Job Applicants.
    This is a forum to help with coding and obstacles you face
    while trying to develop something. If you are looking for a
    package solution, try searching the Internet.

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    remote programming and training
    strive4peace2006 at yahoo.com
    *
    Have an awesome day ;)


    Lin Light wrote:
    > That worked. Could you look at my other question, seeing how you
    > solved this one.
     
  6. Lin Light

    Lin Light
    Expand Collapse
    Guest

    This is the other question that I was referring to. I did posted may 9,06

    Have a table for Orders and a table for Invoices. They are linked by PO.
    Have a form for Data Entry of Invoices. Want a safety check. Have a Combo
    box where I select a PO and the Vendor's name is populated in the form.
    Would like to have the PO number that I use to get the Vendor to populate
    the PO field on the form as well as the Vendor

    --
    Lin Light Herrick District Library


    "strive4peace" wrote:

    > you're welcome, Lin ;) happy to help
    >
    > as for you other question... perhaps you are asking for a
    > bit much ... I do not have a template for Job Applicants.
    > This is a forum to help with coding and obstacles you face
    > while trying to develop something. If you are looking for a
    > package solution, try searching the Internet.
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    > *
    > Have an awesome day ;)
    >
    >
    > Lin Light wrote:
    > > That worked. Could you look at my other question, seeing how you
    > > solved this one.

    >
     
  7. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Re: List Box -- combobox properties

    Hi Lin,

    you said something that makes me wonder how you are storing
    your data, "...the Vendor's name is populated in the
    form..." By this, I hope you mean a calculated control to
    echo its value, not a bound that stores the name again...

    here is an example with the properties you need to set for a
    combobox

    combobox control:

    Name --> VendorID
    ControlSource --> VendorID
    RowSource -->
    SELECT V.VendorID, W.Vendor
    A.Address, A.City, A.State
    FROM Vendors as V
    INNER JOIN Addresses as A
    ON V.AddrID = A.AddrID
    ORDER BY Vendor

    BoundColumn --> 1
    ColumnCount --> 5

    columnWidths --> 0;1.5;1.25;.75;.5
    (etc for however many columns you have
    -- the ID column will be hidden since its width is zero)

    ListWidth --> 4
    (should add up to the sum of the column widths)

    VendorID will be stored in the form RecordSource while
    showing you information from another table...

    If you want to show other information from your combobox in
    other controls, you can use calculated fields.

    For instance

    textbox:
    Name --> Address
    ControlSource --> =VendorID.column(2)

    column indexes start with 0, not 1 in Access -- so column
    index= 2 is really column 3


    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    Lin Light wrote:
    > This is the other question that I was referring to. I did posted may 9,06
    >
    > Have a table for Orders and a table for Invoices. They are linked by PO.
    > Have a form for Data Entry of Invoices. Want a safety check. Have a Combo
    > box where I select a PO and the Vendor's name is populated in the form.
    > Would like to have the PO number that I use to get the Vendor to populate
    > the PO field on the form as well as the Vendor
    >
     
  8. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Re: List Box -- combobox properties

    I see I should have used PO_ID instead of VendorID in my
    example -- since the PO Number determines the vendor, it
    too, is a calculated field...

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    strive4peace wrote:
    > Hi Lin,
    >
    > you said something that makes me wonder how you are storing your data,
    > "...the Vendor's name is populated in the form..." By this, I hope you
    > mean a calculated control to echo its value, not a bound that stores the
    > name again...
    >
    > here is an example with the properties you need to set for a combobox
    >
    > combobox control:
    >
    > Name --> VendorID
    > ControlSource --> VendorID
    > RowSource -->
    > SELECT V.VendorID, W.Vendor
    > A.Address, A.City, A.State
    > FROM Vendors as V
    > INNER JOIN Addresses as A
    > ON V.AddrID = A.AddrID
    > ORDER BY Vendor
    >
    > BoundColumn --> 1
    > ColumnCount --> 5
    >
    > columnWidths --> 0;1.5;1.25;.75;.5
    > (etc for however many columns you have
    > -- the ID column will be hidden since its width is zero)
    >
    > ListWidth --> 4
    > (should add up to the sum of the column widths)
    >
    > VendorID will be stored in the form RecordSource while showing you
    > information from another table...
    >
    > If you want to show other information from your combobox in other
    > controls, you can use calculated fields.
    >
    > For instance
    >
    > textbox:
    > Name --> Address
    > ControlSource --> =VendorID.column(2)
    >
    > column indexes start with 0, not 1 in Access -- so column index= 2 is
    > really column 3
    >
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > Lin Light wrote:
    >
    >> This is the other question that I was referring to. I did posted may
    >> 9,06
    >>
    >> Have a table for Orders and a table for Invoices. They are linked by PO.
    >> Have a form for Data Entry of Invoices. Want a safety check. Have a
    >> Combo
    >> box where I select a PO and the Vendor's name is populated in the form.
    >> Would like to have the PO number that I use to get the Vendor to populate
    >> the PO field on the form as well as the Vendor
    >>
     

Share This Page