List Box

G

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
 
S

strive4peace

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 ;)
 
G

Guest

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


strive4peace said:
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 said:
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
 
S

strive4peace

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 ;)
 
G

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
 
S

strive4peace

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

*
 
S

strive4peace

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

*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top