Is it possible to populate a combobox (just to show related data, not for
selection) on a subform. And in such a way that in datasheet view the
combobox when clicked show the data for the relevant record of the subform.
The subform is related to the mainform of course.
Just a mindgame, suppose I have a mainform which displays persons who own
farms. On the subform all the farms are listed in datasheetview with some
related info. Now I would like to add a combobox which when pressed displays
the animal groups (dogs, cats, pigs, cows etc.) which are living on that
particular farm, so when you go to the next farm of the same person the list
differs.
I have one table with animal and one with the farms and I have a
junctiontable in which the farmid and animalid are stored to create unique
pairs and I have a table with persons. In the farms table the owner is stored
can this be done and if so how.
It might be simple but I am stuck, Thank you
Carl Rapson - 18 May 2007 20:22 GMT
> Is it possible to populate a combobox (just to show related data, not for
> selection) on a subform. And in such a way that in datasheet view the
[quoted text clipped - 17 lines]
> can this be done and if so how.
> It might be simple but I am stuck, Thank you
In the Current event of the farm subform you should be able to populate a
combo box with the animal values from the junction table. You might want to
consider a list box instead of a combo box. You could also do it with an
animal subform embedded on the farm subform, which is itself embedded on the
main form.
Carl Rapson
greeknl - 18 May 2007 20:48 GMT
Thank you,
BUT I have my subform as datasheet view so on every line there should be a
combobox and when selected the combobox should present the data relevant to
the record
Is that possible, even with VBA
>> Is it possible to populate a combobox (just to show related data, not for
>> selection) on a subform. And in such a way that in datasheet view the
[quoted text clipped - 9 lines]
>
>Carl Rapson
Carl Rapson - 18 May 2007 21:59 GMT
Ah, I missed the part about Datasheet view. I don't think that's possible in
Datasheet view. Perhaps you could use Continuous Form view instead? I
believe that view might give you more flexibility while still looking like
Datasheet view.
Carl Rapson
> Thank you,
> BUT I have my subform as datasheet view so on every line there should be a
[quoted text clipped - 19 lines]
>>
>>Carl Rapson
KARL DEWEY - 18 May 2007 20:58 GMT
Try a popup form that has criteria in query from the field in the subform.
The popup is triggered by doulble clicking the field to call an event or
macro.

Signature
KARL DEWEY
Build a little - Test a little
> Is it possible to populate a combobox (just to show related data, not for
> selection) on a subform. And in such a way that in datasheet view the
[quoted text clipped - 13 lines]
> can this be done and if so how.
> It might be simple but I am stuck, Thank you
greeknl - 19 May 2007 09:11 GMT
Thanks I will try that,
but what are the vba codes to get the current active person on the main form
and the current farm(associated with doubbleclicked detail I want) in VBA in
order to have the relevant data to create a query
>Try a popup form that has criteria in query from the field in the subform.
>The popup is triggered by doulble clicking the field to call an event or
[quoted text clipped - 4 lines]
>> can this be done and if so how.
>> It might be simple but I am stuck, Thank you