Linking A Combobox To A Form

FrankG

New member
Local time
Today, 09:08
Joined
Dec 10, 2003
Messages
7
linking combobox and form and visa versa

Hi I am new to this forum, so I give it a start :)
I hope you forgive me my bad english.

I have a form with a combobox that is linked to the form
the list in the combobox is from table1
the form is also table1

When I select something in the combobox the form go to the record that is selected.

But when I choose another record from the form, the combobox does not scrol with it so there is not a sync.

How can i do this that the combobox also scrols when i scrol the form

Thanks form the answers


Greetings


Frank
 
Welcome to the forum FrankG.

To answer your question: you can't have it both ways, at least, not automatically.

The combo box you describe is not a "bound" control (which means that it's not directly linked to a field in table1). If you make a selection from the combo box, that selection is not stored as a value in table1. The purpose of that combo box is to select a record so that the form will then move to that record.

What you describe can be made to work, but it can cause confusion because you don't want your users thinking the combo box is a bound control when it's really not.

If you are intent on getting it to work though, you'll need some code in the form's On Current event to get the combo box to sync to the rest of the form. You do realize that when you sync the combo box to the form, that changing the value in the combo box will resynch the form to the combo box.
 
I know what you say, but the combo box is a sort of quick searchbox.
And when you see the screen its more confusing when it is not scrolling with eachother.
How do i write the code in the form.
I am searching how I must control te controlbox, but ....
Can someone help me find it out
 
Most developers put quick search fields in a separate part of the form like the header. You can even leave them as part of the main form, just have them in a different color, within their own box, etc... anyway you want, so that they are made to look visually different from the other bound fields on the form.
 
thanks for your answer.
Its indeed a nice way to do so.
But that leaves me with my open question.
How can i control from VbA my combobox?
I want i to go to a sertain record


I am getting the fun proggin in access :)
 
But isn't that the part that IS working correctly? Your first post says:
When I select something in the combobox the form go to the record that is selected.
 
Ok, I found out how to do it myself

The listbox has a variable that called defaulvalue when you do this in VBA me.listbox.defaulvalue = IDform and then refresh you got the effect that the listbox scrols with the form

You can place this on a event
 

Users who are viewing this thread

Back
Top Bottom