List Box/Header

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form called frmContacts and a subform called frmIndividuals subform.

In the frmContacts form I have a command button set up which takes you to
the subform. You can then enter all the individuals for that company.

In the header of the individuals subform, I created navigation buttons to
scroll through all the individuals. My problem is that instead of using
these buttons, users in our office are just typing over the first contacts
name, changing it until they realize that won't work. Although I've
explained several times that they need to use the navigation buttons to
scroll to the individual they are looking for, it just is not getting
through. So I would like to instead of the navigation buttons have a list
box in the header which lists the current individuals set up under the
contact and when clicked it pulls up the individual you click on, is this
possible? Or do you have any other suggestions? I am very new to access, so
please be gentle.
 
Only a suggestion....

1. Use a COMBO BOX and restrict it to the list. Place the COMBO box in the
form header.

This allows only those in the table to be selected.

The records then will automatically scroll to the right record based on
their selection in the COMBO box.

If you Fieldname.Dropdown in the OnGotFocus event of the combo box as they
type it will automatically begin locating the record.

I think this will work better than all the boxes.

Hitting enter in the combo box will then using the tab setting autmatically
move the cursor the subform. Or you can use a setfocus command in the
afterupdate or on a command button to make it move to the subform first field
or where ever you like.'


Hope this will help.
 
I am new to access, so when you say "restrict it to the list", I don't know
what you mean. Using one combo box does not work...the combo box is showing
all the individuals out there for all the companies on our database not just
the company that I am in on the screen. Do you or anyone else know how to
just have the combo box just pull down those individuals for the company on
the screen?
 
Ok Open your subform in design view. Using the "VIEW" option at the top make
sure the form has a header and footer if not add one. Whether you use the
footer or not is irrelevant. Now using the Design View ComboBox option
select it and place it in the header of the subform. ACCESS will ask you if
you want to type in the list or get it from a table select the appropriate
table your subform is attached to in the Record Source.

Click on the unique row id, name or item that is unique for each record.

You will be ask if you want the Combo Box to find a record on your form and
select yes or the FIND a RECORD ON MY FORM etc.....

NOW the link is set.

Open the form and using the COMBO22.SetFocus process or DoCmd.GoToControl
"COMBO22" in the On Load even to get to the Combo box selection field. In
the ON GOT FOCUS of the COMBO22 place this code to open the combo list.
Combo22.Dropdown ( I think that code right if now look up list dropdown in
help)

That is about it. Close the form and save it Now when you open the subform
the cursor will move to the combo box and it should open the list showing
about 8 rows as that is the default setting. In Design view after having the
combo box set up go into the events and set the LIMIT TO LIST function to
YES. This will allow only records in the table to be typed in and found
others a default message of NOT IN LIST will appear.

Now to find someone. Place the cursor in the COMBO Box list and click on it
then hit enter. Now the subform should move to the appropriate record in the
table holding he information.

In order to have duplicate name entries in the table and actually find the
one you want you must use like a EmpNameID. This AutoNumber field would
change for each employee in the COMBO box whenfirst entered into the table.
IN the COMBO Box display the names like last name andfirst name but use the
ID NUMBER to actually set the rows unique field to move on.

TRY THIS And see if this won't give you what you need there is almost no
code required if you use the wizard for the combo box...

HOPE THIS IS HELPFUL......IF NOT GET BACK TO ME....

Dwight
 
Back
Top