select item on cboBox containing a namelist

G

Gina

Hi.

my combobox cboSearch contains a list of surnames and forenames (as well as
the customer id - invisible)

according to a certain selection, the form displays the corresponding data.
fine

surname as well as forename are displayed again on the form in a textbox ...
so that the user can do some changes
buttons to move forward and backward through the records a available .

if a user now presses the forward/backward button I would like the cboSearch
to update and show the name that is selected on the forms txtSurname.

how could I accomplish that

Thanks,
Gina
 
R

Rob Oldfield

You want the next/previous options to show the next/previous record that
matches your search criteria? If you don't mean that, then could you give
an example of what you're after?
 
G

Gina

Thanks Rob,

well, yes that's probably what I intend to show in that cboSearch
.... the name in the cbo box should be the same as the one shown in the form
which is selected via next/prev record button

but I still do not know how to do that

Gina
 
R

Rob Oldfield

I'm still confused. It'd again be easiest if you could give an example of
what you want to happen.
 
G

Gina

Hi Rob.

The cbo box searches and finds records according to selection. now when I
move around the recordsets via prev/next (findNext) button the records
change (of course / or hopefully they do ;) ...) but the item in the cbo box
still remains the same .... is exactly the one I selected whereas I am on a
different record which I selected via my buttons.

What I would like the cbo box to do is to show the current record which is
shown when I click on the findNext / findPrev button in my form

hope that I could be more clearer ?!

Thanks,
Gina
 
R

Rob Oldfield

aaahhh.... got you. You want the combo to update to reflect edits that
you've made. You just need to requery it, though you'd also need to make
sure that the change is written back to the table first. So in the after
update event of the surname and firstname controls you'd do something
like...

docmd.runcommand accmdselectrecord
me.cboControlName.requery

(..that's if the combo is on the same form - which I think it is...
otherwise it would be forms!formname!cboControlName.requery)
 
G

Gina

well ... got what you mean but thats not the problem .. it updates to
reflect changes to to actual names

what I want it i reflect is the actual record in case I move forward and
backward on the same form via my two buttons which have as code e.g

NEXT record: DoCmd.GoToRecord , , acNext
PREV record: DoCmd.GoToRecord , , acPrevious
NEW record:

DoCmd.GoToRecord , , acNewRec
Me.cboSearch.Requery


as you can see it reflects the new added records ....

but if I move via NEXT or PREV the cbo box doesn't show the current record

some things can be so difficult ....
still havn't a clou how to solve it

Gina
 

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