Kamis, 29 Mei 2014

Re: [MS_AccessPros] Selection on subform returns a count

 

It is very unclear what you are saying. I interpret this to be that there are 645 records in the subform, there is a field called selectiontype and the value "First" is selected,  and there is a field community with "Eagle Butte" selected. So something like this in the after update of the community field.

Me.Parent.SomeTextBox.value = me.SelectionType & " Selection " & me.Community & " " & me.recordset.recordcount & " selections." 


On Thu, May 29, 2014 at 7:08 PM, dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
 

I have my main form called frmApplicantDetail and on it is a subform called sfrmCommunitySelect.


The subform sfrmCommunitySelect is comprised of the following fields from the table tblCommunitySelect:


CommunitySelectID - PK

ApplicantID - Applicant ID

SelectTypeID - Lookup into the tlkpSelectType table (a dropdown list on the subform)

CommunityID - Lookup to the tlkpCommunity table (a dropdown list on the subform)


Back on the mainform I have a textbox called txtFirstSelectionCount in which I would like to populate with the number of selection already in the system based on what is selected in the subform. I have query written that counts the selection already called CommunitySelectionCount:


SELECT Count(tblCommunitiesSelected.CommunitiesID) AS CountOfCommunitiesID, tlkpCommunity.CommunityName, tlkpSelectionType.SelectionTypeName, tblApplication.IsCurrent
FROM ((tblCommunitiesSelected LEFT JOIN tlkpCommunity ON tblCommunitiesSelected.CommunityID = tlkpCommunity.CommunityID) LEFT JOIN tlkpSelectionType ON tblCommunitiesSelected.SelectionTypeID = tlkpSelectionType.SelectionTypeID) INNER JOIN tblApplication ON tblCommunitiesSelected.ApplicationID = tblApplication.ApplicationID
GROUP BY tlkpCommunity.CommunityName, tlkpSelectionType.SelectionTypeName, tblApplication.IsCurrent
HAVING (((tblApplication.IsCurrent)=True));


Now the scenario - The user select First from the SelectionType field in the subform and then selects Eagle Butte from the Community field in the subform. Based on that selection I want to return to the textbox on the main form "First Selection Eagle Butte 645 selections" or something of that nature.


Any ideas?


Thank you

Art Lorenzini

Sioux Falls, SD


__._,_.___

Posted by: Peter Poppe <plpoppe@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar