PC Review


Reply
Thread Tools Rate Thread

Combobox values as query releted to current record

 
 
greeknl via AccessMonster.com
Guest
Posts: n/a
 
      18th May 2007
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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200705/1

 
Reply With Quote
 
 
 
 
Carl Rapson
Guest
Posts: n/a
 
      18th May 2007
"greeknl via AccessMonster.com" <u30909@uwe> wrote in message
news:725f1fdd05323@uwe...
> 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
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...forms/200705/1
>


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


 
Reply With Quote
 
greeknl via AccessMonster.com
Guest
Posts: n/a
 
      18th May 2007
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


Carl Rapson wrote:
>> 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


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200705/1

 
Reply With Quote
 
=?Utf-8?B?S0FSTCBERVdFWQ==?=
Guest
Posts: n/a
 
      18th May 2007
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.
--
KARL DEWEY
Build a little - Test a little


"greeknl via AccessMonster.com" wrote:

> 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
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...forms/200705/1
>
>

 
Reply With Quote
 
Carl Rapson
Guest
Posts: n/a
 
      18th May 2007
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

"greeknl via AccessMonster.com" <u30909@uwe> wrote in message
news:725ffb09372f6@uwe...
> 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
>
>
> Carl Rapson wrote:
>>> 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

>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...forms/200705/1
>



 
Reply With Quote
 
greeknl via AccessMonster.com
Guest
Posts: n/a
 
      19th May 2007
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

KARL DEWEY wrote:
>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.
>> 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


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200705/1

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBox: Update a value in current record before changing the ComboBox Value disneygoof via AccessMonster.com Microsoft Access Form Coding 2 17th Mar 2008 02:43 PM
Dependant Combobox not showing current value if record viewed =?Utf-8?B?UHVyZVJhZGlhbnRKb3k=?= Microsoft Access Form Coding 1 23rd Aug 2007 11:49 PM
ComboBox Current Record Pointer =?Utf-8?B?U3RldmUgUw==?= Microsoft Access Form Coding 3 25th Oct 2006 01:57 AM
Bind a comboBox to the current record in the dataset dbuchanan Microsoft Dot NET Framework Forms 0 11th May 2005 11:27 PM
Use ComboBox to select Current Record in Databinding? Luther Miller Microsoft Dot NET Framework Forms 0 10th Dec 2003 01:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:32 PM.