combo boxes navigation

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Combo Boxes / Navigation

Combo Boxes / Navigation

resolvedResolved · Urgent Priority · Version 2007

Darren has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course

Combo Boxes / Navigation

Dear Sir,
I have recently added a search function to one of my existing databases using a combo box, this simply uses a persons name to search through the existing table (I used the wizard to set this up).

The search box (combo box) is positioned at the top of the form. When I type the persons name into the box and press enter it finds the record perfectly. However, if I use the tab key to move from the combo box to the next field it moves it to the next record. For example:

1) I type Smith in the combo box and the record appears for Mr Smith (record number 340);

2) I use the tab key to move to the next field and it changes to record 341.

Can you tell me how to stop the record changing when I press the tab key please.

Kind regards,

Darren.

RE: Combo Boxes / Navigation

Hi Darren

Thank your for your question

I have built a simple for and managed to replicate the effect you report. Off hand I can see no reason why it should behave in this manner, but I will explore the issues and try to come up with an answer.
In the meantime I would suggest not using the wizard to set up the combo box, but rather writing the VBA code to do it. In short you need to

Create an after update event for the combo box that

a. Builds an SQL string that selects the person specified in the combo box from the table.
b. Sets the form's control source property to the value of that string

This should then solve the problem, and produce something rather more robust than is provided by the wizard

Regards

Stephen

Tue 7 Jul 2009: Automatically marked as resolved.


 

Access tip:

Change case

To change case from upper or lower case, highlight the text area, hold down the Shift key and pres F3

View all Access hints and tips


Server loaded in 0.08 secs.