Senin, 16 Juli 2018

Re: RE: [MS_AccessPros] Subform is not refreshing

 

Yep that what did the trick...

Forms![frmTenantListingDashboard]![sfrmTenantList].Form.RecordSource = strSql
Forms![frmTenantListingDashboard]![sfrmTenantList].Form.Requery



With Warm Regards,
 
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265  Ext. 130
Fax (605)964-1070

"Valar Dohaeris"






On ‎Monday‎, ‎July‎ ‎16‎, ‎2018‎ ‎12‎:‎00‎:‎12‎ ‎PM‎ ‎CDT, Liz Ravenwood liz_ravenwood@beaerospace.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:


 

I didn't review the entire code, but I'm always needing to add in a

Formname.subformname.form.requery

In there

Respectfully,
[RCEmailSigLogo]
Liz Ravenwood
Data Technologies
Interior Systems
Rockwell Collins
1851 So. Pantano Rd, Tucson, AZ 85710 USA
(520) 239-4808
Liz_ravenwood@beaerospace.com<mailto:Liz_ravenwood@beaerospace.com>
rockwellcollins.com<http://www.rockwellcollins.com/>

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Monday, July 16, 2018 9:22 AM
To: dbalorenzini@yahoo.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] Subform is not refreshing




Unless someone has a better idea. I came up with this.


If IsNull(Me.cmbChooseCommunity) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "q_TenantListing"
Else
strSql = "SELECT DISTINCTROW q_TenantListing.* FROM q_TenantListing " & _
"WHERE q_TenantListing.CommunityID = " & Me.cmbChooseCommunity & ";"
'Me.RecordSource = strSql
Forms![frmTenantListingDashboard]![sfrmTenantList].Form.RecordSource = strSql
Forms![frmTenantListingDashboard]![sfrmTenantList].Form.Requery
End If

It seems to work...

With Warm Regards,

Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265 Ext. 130
Fax (605)964-1070

"Valar Dohaeris"





On ‎Monday‎, ‎July‎ ‎16‎, ‎2018‎ ‎10‎:‎05‎:‎22‎ ‎AM‎ ‎CDT, dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have a main form called frmTenantListingDashboard and on it I have a combo box called cmbChooseCommunity. Source for the combo box is:

SELECT tlkpCommunity.CommunityID, tlkpCommunity.CommunityName FROM tlkpCommunity UNION SELECT 0,"All" FROM tlkpCommunity ORDER BY CommunityName;

Also on this form I have a subform called sfrmTenantList which is defined as a continuous form with the following record source:

SELECT B4602200.NAME, tblUnit.UnitCode, tblUnit.BedroomCount, tblUnit.CurrentStatus, tblUnit.UnitStatus, tblUnit.ClassificationType, tblUnit.UnitHousingType, tlkpCommunity.CommunityName, B4602200.BSSI_Tenant_Lease_Status, B4602200.CUSTNMBR, B4602200.BSSI_Lease_Execution_Dat AS Move_In_Date, Trim([ADDRESS1]) & ", " & Trim([CITY]) & ", " & Trim([STATE]) & " " & Trim([Zip]) AS TenantAddress, tblUnit.UnitID, tblUnit.CommunityID
FROM ((B4602200 INNER JOIN tblUnit ON B4602200.LOCNCODE = tblUnit.UnitCode) INNER JOIN tlkpCommunity ON tblUnit.CommunityID = tlkpCommunity.CommunityID) INNER JOIN RM00101 ON B4602200.CUSTNMBR = RM00101.CUSTNMBR
WHERE (((tblUnit.CurrentStatus)="CRHA Use") AND ((tblUnit.UnitStatus)<>"Vacant") AND ((tblUnit.ClassificationType)="Rental") AND ((B4602200.BSSI_Tenant_Lease_Status)=2))
ORDER BY tblUnit.UnitCode, B4602200.BSSI_Lease_Execution_Dat, RM00101.CUSTNMBR;
Now in the AfterUpdate event of cmbChooseCommunity I have the following code:


If IsNull(Me.cmbChooseCommunity) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "q_TenantListing"
Else
strSql = "SELECT DISTINCTROW q_TenantListing.* FROM q_TenantListing " & _
"WHERE q_TenantListing.CommunityID = " & Me.cmbChooseCommunity & ";"
Me.RecordSource = strSql
End If

Now I debug this and ran the strSQL and the generated command does return data but it does not refresh the subform with the returned data. Any ideas?

Thank you ,

Art Lorenzini
Sioux Falls, SD









This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

[Non-text portions of this message have been removed]

__._,_.___

Posted by: Art Lorenzini <dbalorenzini@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar