Full Version: Help needed with RowSource of Combobox
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Krazeyivan
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!
Krazeyivan
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
Larry Larsen
Hi Liam
Try:
Forms!Mainform!Subform1.Form.RecordSource
Refernce: Refer to Form and Subform properties and controls.
HTH's
thumbup.gif
Krazeyivan
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.