Rabu, 29 Mei 2013

RE: [MS_AccessPros] How am I to tell the report to use the form’s record source?

Phucon,

Tell us how you are using the combo box to filter the form records. I expect you could use a similar expression as a WHERE CONDITION in the DoCmd.OpenReport method.

Duane Hookom MVP
MS Access

----------------------------------------
> From: saigonf7q5@yahoo.com
>
> My form has a combo box for filtering records, and a Cmdbutton to open a report.
>
> I have been trying to pass the form's OpenArgs to the Report_Open procedue, so the report's Recordsource can base on the criteria that the user selected from the form. How am I to tell the report to use the form's record source?
>
> Below's what I have been trying to do.
>
> Private Sub cmdOpenRpt_Click()
>
> Dim strCntryName As String
>
> strCntryName = Me.cboCountry
>
> DoCmd.OpenReport "RptCustomers", acViewPreview, , , acWindowNormal, strCntryName
>
> End Sub
>
> Private Sub Report_Open(Cancel As Integer)
> Me.OpenArgs
> End Sub
>
> Thanks
> Phucon

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)

<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Tidak ada komentar:

Posting Komentar