UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help needed with RowSource of Combobox    
 
   
Krazeyivan
post May 31 2005, 06:24 AM
Post #1

UtterAccess Guru
Posts: 648
From: Newcastle, UK



Hi

In the following I am a bit stuck - I need it to make sure it only selects records that Current Status = "Open"
Having hard job of putting this in as well, cos my VB skills are in need of work.

In my cboLocation afterupdate event -

QUOTE
Private Sub cboLocation_AfterUpdate()
Dim sLocationSource As String

sLocationSource = "SELECT [tblLocationTrial].[LocationTrialID], [tblLocationTrial].[locationFK], [tblLocationTrial].[CurrentStatus] " & _
"FROM tblLocationTrial " & _
"WHERE [locationFK] = " & Me.cboLocation.Value
Problem is also below - this combo is on a subform and needs to set the combo rowsource
of another combo on the mainform in a different tab control.

Me.cboTrial.RowSource = sLocationSource
Me.cboTrial.Requery
End Sub


Thanks in advance!
Go to the top of the page
 
+
Krazeyivan
post May 31 2005, 07:15 AM
Post #2

UtterAccess Guru
Posts: 648
From: Newcastle, UK



Right I think I have sorted the current Status problem

But I am a bit lost with my combo problem, I made a mistake before too - the other combo that needs updated is on another subform on my main form.

Do I have to do something like the following

[Forms]![fsubTrialResp].[Form]!cboTrial.Rowsource ??


Cheers

Liam
Go to the top of the page
 
+
Larry Larsen
post May 31 2005, 07:20 AM
Post #3

UA Editor + Utterly Certified
Posts: 22,722
From: Melton Mowbray,Leicestershire (U.K)



Hi Liam
Try:
Forms!Mainform!Subform1.Form.RecordSource
Refernce: Refer to Form and Subform properties and controls.
HTH's
(IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+
Krazeyivan
post May 31 2005, 08:25 AM
Post #4

UtterAccess Guru
Posts: 648
From: Newcastle, UK



hi Larry

Cheers for that - am muddling through with this - it is a pain sorting combo record sources when you are in the "subform" domain!

Liam
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 11:47 PM