PC Review


Reply
Thread Tools Rate Thread

combo box linked subform values

 
 
Mitchell_Collen via AccessMonster.com
Guest
Posts: n/a
 
      27th Apr 2007
I have created a subform and a combo box. When the user selects a value in
the combo box such as unit4, they should be able to see only unit4 details in
the subform. This is my trouble. Does anybody know how to get a combo value
to determine the subform data? I have created numerous queries and functions
but can't get this to work. Please help.

Thanks, Mitchell

--
Message posted via http://www.accessmonster.com

 
Reply With Quote
 
 
 
 
Damon Heron
Guest
Posts: n/a
 
      27th Apr 2007
Without knowing all your specifics, the general solution is similar to the
following:
(the subform has a sql string to load records)

Private Sub cboUnits_AfterUpdate()
Dim strsql As String
strsql = "SELECT tblUnits.UnitID, tblUnits.Available, tblUnits.Applied,
tblUnits.Description " & _
"FROM tblUnits WHERE ((tblUnits.UnitID) = " & cboUnits.Value & ")"

Me![tblUnits subform].Form.RecordSource = strsql
Me![tblUnits subform].Form.Requery
End Sub


HTH
Damon

"Mitchell_Collen via AccessMonster.com" <u33726@uwe> wrote in message
news:7155e2dad8e9b@uwe...
>I have created a subform and a combo box. When the user selects a value in
> the combo box such as unit4, they should be able to see only unit4 details
> in
> the subform. This is my trouble. Does anybody know how to get a combo
> value
> to determine the subform data? I have created numerous queries and
> functions
> but can't get this to work. Please help.
>
> Thanks, Mitchell
>
> --
> Message posted via http://www.accessmonster.com
>



 
Reply With Quote
 
Mitchell_Collen via AccessMonster.com
Guest
Posts: n/a
 
      27th Apr 2007
Thanks Damon.

-Mitchell

Damon Heron wrote:
>Without knowing all your specifics, the general solution is similar to the
>following:
>(the subform has a sql string to load records)
>
>Private Sub cboUnits_AfterUpdate()
>Dim strsql As String
>strsql = "SELECT tblUnits.UnitID, tblUnits.Available, tblUnits.Applied,
>tblUnits.Description " & _
> "FROM tblUnits WHERE ((tblUnits.UnitID) = " & cboUnits.Value & ")"
>
>Me![tblUnits subform].Form.RecordSource = strsql
>Me![tblUnits subform].Form.Requery
>End Sub
>
>HTH
>Damon
>
>>I have created a subform and a combo box. When the user selects a value in
>> the combo box such as unit4, they should be able to see only unit4 details

>[quoted text clipped - 6 lines]
>>
>> Thanks, Mitchell


--
Message posted via http://www.accessmonster.com

 
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
Using Linked Combo Boxes with a subform LBRT Microsoft Access Forms 1 3rd Jan 2010 01:48 AM
Subform linked to combo box sharontodd Microsoft Access VBA Modules 2 16th Sep 2009 02:51 AM
Linked combo boxes on subform =?Utf-8?B?SGVsZW5K?= Microsoft Access Forms 3 3rd Dec 2005 06:15 PM
Linked combo box in subform =?Utf-8?B?U2hhbm5vbg==?= Microsoft Access 1 16th Aug 2005 12:15 AM
Subform linked to combo box LindaL. Microsoft Access Forms 1 19th Feb 2004 09:14 PM


Features
 

Advertising
 

Newsgroups
 


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