Sabtu, 01 Juni 2013

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

 

I can't see ever using the looping code to display multiple records in a form or report. I often use looping code to display records in a web page where the loop create <tr></tr> for each record.

Duane Hookom MVP
MS Access

----------------------------------------
> To: MS_Access_Professionals@yahoogroups.com
> From: saigonf7q5@yahoo.com
> Date: Sun, 2 Jun 2013 00:51:20 +0000
> Subject: Re: [MS_AccessPros] How am I to tell the report to use the form�s record source?
>
>
>
>
> Thank you very much Bill.Now it loads and filters the records correctly.
>
> Another question that I have, is, when should the Looping method (the procedure which I posted) be used.
>
> Thanks Bill
>
> Phucon
>
> --- In MS_Access_Professionals@yahoogroups.com, "Bill Mosca" <wrmosca@...> wrote:
>>
>> Phucon
>>
>> PMJI...You can't load the recordset that way. You are trying to do it one record at a time. Just assign each control's ControlSource to the appropriate field. Don't loop through the records.
>>
>> With Me
>> .pkeyCustomerID.ControlSource = "pkeyCustomerID"
>> .strCompanyName.ControlSource = "strCompanyName"
>> .strContactName.ControlSource = "strContactName"
>> .strContactTitle.ControlSource = "strContactTitle"
>> .strCity.ControlSource = "strCity"
>> .strRegion.ControlSource = "strRegion"
>> .strPostalCode.ControlSource = "strPostalCode"
>> .strCountry.ControlSource = "strCountry"
>> End With
>>
>> Me.RecordSource = strSQL
>> Me.Requery
>>
>> Regards,
>> Bill Mosca, Founder - MS_Access_Professionals
>> http://www.thatlldoit.com
>> Microsoft Office Access MVP
>> https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
>> My nothing-to-do-with-Access blog
>> http://wrmosca.wordpress.com
>>
>>
>>
>> --- In MS_Access_Professionals@yahoogroups.com, "saigonf7q5" <saigonf7q5@> wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>> Thanks Duane. It works perfectly.
>>>
>>> I tried another version of displaying records on the (Continuous) form. However I can't figure out why it keeps displaying the same record while it should move to the next. I suspected the MoveNext statement wasn't placed correctly. was it? Phucon.
>>>
>>> RANCH Rancho grande Sergio Guti�rrez Sales Representative Buenos Aires 1010 Argentina
>>> RANCH Rancho grande Sergio Guti�rrez Sales Representative Buenos Aires 1010 Argentina
>>> RANCH Rancho grande Sergio Guti�rrez Sales Representative Buenos Aires 1010 Argentina
>>>
>>>
>>> Private Sub cboCountry_AfterUpdate()
>>>
>>> Dim db As DAO.Database
>>> Dim rs As DAO.Recordset
>>> Dim strSQL As String
>>>
>>> strSQL = "SELECT distinct pkeyCustomerID, strCompanyName, strContactName, strContactTitle, strCity, strRegion, " & _
>>> "strPostalCode, strCountry " & _
>>> "FROM qryCustomers WHERE strCountry= " & Chr$(34) & Me.cboCountry & Chr$(34) & ""
>>>
>>> Set db = CurrentDb
>>> Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
>>>
>>> Me.RecordSource = strSQL
>>>
>>> If Not rs.EOF Then
>>> Do
>>> With Me
>>> .pkeyCustomerID = rs!pkeyCustomerID
>>> .strCompanyName = rs!strCompanyName
>>> .strContactName = rs!strContactName
>>> .strContactTitle = rs!strContactTitle
>>> .strCity = rs!strCity
>>> .strRegion = rs!strRegion
>>> .strPostalCode = rs!strPostalCode
>>> .strCountry = rs!strCountry
>>> End With
>>> rs.MoveNext
>>> Loop Until rs.EOF
>>> End If
>>>
>>> rs.Close
>>> Set rs = Nothing
>>> Set db = Nothing
>>>
>>> End Sub
>>>
>>>
>>> --- In MS_Access_Professionals@yahoogroups.com, Duane Hookom <duanehookom@> wrote:
>>>>
>>>> Try,
>>>>
>>>> Private Sub cmdOpenRpt_Click()
>>>> �
>>>> � �Dim strWhere as String
>>>> � �strWhere = Me.Filter
>>>> � �DoCmd.OpenReport "RptCustomers", acViewPreview, ,strWhere , acWindowNormal
>>>>
>>>> End Sub
>>>>
>>>> Duane Hookom MVP
>>>> MS Access
>>>>
>>>> ----------------------------------------
>>>>> From: saigonf7q5@
>>>>>
>>>>> Hello Duane
>>>>>
>>>>> Here's the 2 procedures that in the form.
>>>>>
>>>>> combo box rowsource:
>>>>> SELECT DISTINCT qryCustomers.strCountry FROM qryCustomers;
>>>>>
>>>>> criteria which user enters:
>>>>> Private Sub cboCountry_AfterUpdate()
>>>>>
>>>>> Me.Filter = "strCountry = " & Chr$(34) & Me.cboCountry & Chr$(34) & ""
>>>>> Me.FilterOn = True
>>>>>
>>>>> 'Debug.Print Me.Filter
>>>>>
>>>>>
>>>>> End Sub
>>>>>
>>>>>
>>>>> Private Sub cmdOpenRpt_Click()
>>>>>
>>>>> Dim strCntryName As String
>>>>> strCntryName = Me.cboCountry
>>>>>
>>>>> DoCmd.OpenReport "RptCustomers", acViewPreview, , , acWindowNormal, strCntryName
>>>>>
>>>>> End Sub
>>>>>
>>>>>
>>>>>
>>>>> --- In MS_Access_Professionals@yahoogroups.com, Duane Hookom <duanehookom@> wrote:
>>>>>>
>>>>>> 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@
>>>>>>>
>>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)
Recent Activity:
.

__,_._,___

RE: [MS_AccessPros] Concatenating names in a group.

 

You can use the generic concatenate function at http://www.tek-tips.com/faqs.cfm?fid=4233.

Duane Hookom MVP
MS Access

> From: robinski@mymail.net.au
>
> I have a dataset that includes 'ClubName' and 'Group'.
>
> GroupID ClubName
> 1 Club 1
> 2 Club 7
> 1 Club 11
> 2 Club 17
> 1 Club 21
> 2 Club 37
>
> and so on.
>
> Clubs are arranged in groups and I need a query that gives me a
> result like this in two fields:
>
> Group One - Club 1; Club 2; Club 3; etc
> Group Two - Club 22; Club 27; Club 40; etc
>
> Many thanks,
> Robin Chapple



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

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
.

__,_._,___

Bls: [belajar-access] cari bahan untuk skripsi

 

Salam kenal mas Fauzi,

Ditempat mas fauzi boleh ya bikim Tugas Akhir (Skripsi) menggunakan Access? aku juga mau siap2 bikin TA nih, tapi ditempat aku masih belum diperbolehkan menggunakan Access, kata para dosen aku, Access terlalu sederhana, apakah demikian master/suhu Access?

 


Best Regards,


Sukiono
PT. Kumala Kencana Cipta
www.kumalahome.com


Dari: Faudzy <fauzy_07@yahoo.co.id>
Kepada: belajar-access@yahoogroups.com
Dikirim: Jumat, 31 Mei 2013 13:06
Judul: [belajar-access] cari bahan untuk skripsi

 
Dear Master Access
 
Saya akan menyusun Skripsi dan belum mempunyai bahannya..
Rencananya akan menggunakan Inventory perusahaan…
Sekiranya ada yang bisa membantu saya dalam mencari Referensi Skripsi tentang Inventori.
 
Sebelumnya saya ucapkan banyak terima kasih.
 
Faudzy


__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
SPAM IS PROHIBITED
.

__,_._,___

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

 



Thank you very much Bill.Now it loads and filters the records correctly.

Another question that I have, is, when should the Looping method (the procedure which I posted) be used.

Thanks Bill

Phucon

--- In MS_Access_Professionals@yahoogroups.com, "Bill Mosca" <wrmosca@...> wrote:
>
> Phucon
>
> PMJI...You can't load the recordset that way. You are trying to do it one record at a time. Just assign each control's ControlSource to the appropriate field. Don't loop through the records.
>
> With Me
> .pkeyCustomerID.ControlSource = "pkeyCustomerID"
> .strCompanyName.ControlSource = "strCompanyName"
> .strContactName.ControlSource = "strContactName"
> .strContactTitle.ControlSource = "strContactTitle"
> .strCity.ControlSource = "strCity"
> .strRegion.ControlSource = "strRegion"
> .strPostalCode.ControlSource = "strPostalCode"
> .strCountry.ControlSource = "strCountry"
> End With
>
> Me.RecordSource = strSQL
> Me.Requery
>
> Regards,
> Bill Mosca, Founder - MS_Access_Professionals
> http://www.thatlldoit.com
> Microsoft Office Access MVP
> https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
> My nothing-to-do-with-Access blog
> http://wrmosca.wordpress.com
>
>
>
> --- In MS_Access_Professionals@yahoogroups.com, "saigonf7q5" <saigonf7q5@> wrote:
> >
> >
> >
> >
> >
> >
> > Thanks Duane. It works perfectly.
> >
> > I tried another version of displaying records on the (Continuous) form. However I can't figure out why it keeps displaying the same record while it should move to the next. I suspected the MoveNext statement wasn't placed correctly. was it? Phucon.
> >
> > RANCH Rancho grande Sergio Guti�rrez Sales Representative Buenos Aires 1010 Argentina
> > RANCH Rancho grande Sergio Guti�rrez Sales Representative Buenos Aires 1010 Argentina
> > RANCH Rancho grande Sergio Guti�rrez Sales Representative Buenos Aires 1010 Argentina
> >
> >
> > Private Sub cboCountry_AfterUpdate()
> >
> > Dim db As DAO.Database
> > Dim rs As DAO.Recordset
> > Dim strSQL As String
> >
> > strSQL = "SELECT distinct pkeyCustomerID, strCompanyName, strContactName, strContactTitle, strCity, strRegion, " & _
> > "strPostalCode, strCountry " & _
> > "FROM qryCustomers WHERE strCountry= " & Chr$(34) & Me.cboCountry & Chr$(34) & ""
> >
> > Set db = CurrentDb
> > Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
> >
> > Me.RecordSource = strSQL
> >
> > If Not rs.EOF Then
> > Do
> > With Me
> > .pkeyCustomerID = rs!pkeyCustomerID
> > .strCompanyName = rs!strCompanyName
> > .strContactName = rs!strContactName
> > .strContactTitle = rs!strContactTitle
> > .strCity = rs!strCity
> > .strRegion = rs!strRegion
> > .strPostalCode = rs!strPostalCode
> > .strCountry = rs!strCountry
> > End With
> > rs.MoveNext
> > Loop Until rs.EOF
> > End If
> >
> > rs.Close
> > Set rs = Nothing
> > Set db = Nothing
> >
> > End Sub
> >
> >
> > --- In MS_Access_Professionals@yahoogroups.com, Duane Hookom <duanehookom@> wrote:
> > >
> > > Try,
> > >
> > > Private Sub cmdOpenRpt_Click()
> > > �
> > > � �Dim strWhere as String
> > > � �strWhere = Me.Filter
> > > � �DoCmd.OpenReport "RptCustomers", acViewPreview, ,strWhere , acWindowNormal
> > >
> > > End Sub
> > >
> > > Duane Hookom MVP
> > > MS Access
> > >
> > > ----------------------------------------
> > > > From: saigonf7q5@
> > > >
> > > > Hello Duane
> > > >
> > > > Here's the 2 procedures that in the form.
> > > >
> > > > combo box rowsource:
> > > > SELECT DISTINCT qryCustomers.strCountry FROM qryCustomers;
> > > >
> > > > criteria which user enters:
> > > > Private Sub cboCountry_AfterUpdate()
> > > >
> > > > Me.Filter = "strCountry = " & Chr$(34) & Me.cboCountry & Chr$(34) & ""
> > > > Me.FilterOn = True
> > > >
> > > > 'Debug.Print Me.Filter
> > > >
> > > >
> > > > End Sub
> > > >
> > > >
> > > > Private Sub cmdOpenRpt_Click()
> > > >
> > > > Dim strCntryName As String
> > > > strCntryName = Me.cboCountry
> > > >
> > > > DoCmd.OpenReport "RptCustomers", acViewPreview, , , acWindowNormal, strCntryName
> > > >
> > > > End Sub
> > > >
> > > >
> > > >
> > > > --- In MS_Access_Professionals@yahoogroups.com, Duane Hookom <duanehookom@> wrote:
> > > >>
> > > >> 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@
> > > >>>
> > > >>> 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
> > > >
> > > >
> > > >
> > >
> >
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
Recent Activity:
.

__,_._,___

[belajar-access] File - Tata Tertib dan Aturan.txt

 


Tata tertib dan peraturan
Mailing List: belajar-access@yahoogroups.com

1. Mailing list ini membahas mengenai pemrograman Microsoft Access.
2. Tidak diperkenankan mem-posting topik yang tidak ada kaitannya sama sekali dengan pemrograman MS Access, peluang kerja atau tawaran kerja sama dengan keahlian di bidang MS Access, atau pengajaran/kursus MS Acces. Pelanggaran terhadap aturan ini akan di-ban dari keanggotaan milis ini.
3. Mohon berdiskusi dengan baik, dengan semangat membangun, demi kemajuan kita bersama. Hindarilah perbantahan (flame) yang bisa menjadi pertengkaran yang tidak perlu.
4 Hindari reply permintaan one-liner seperti 'saya minta juga dong', 'saya setuju', dan lain-lain yang tidak perlu.
5. Sedapat mungkin memberikan data-data yang lengkap dalam mengajukan suatu masalah untuk memudahkan rekan-rekan sesama member mengidentifikasi dan mencarikan solusi, termasuk memberikan subject yang sesuai dengan isi email, tidak dengan kata-kata seperti "tologing dong", "pusing...", "ada yang bisa bantu..", dll.

Moderator

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (75)
Recent Activity:
SPAM IS PROHIBITED
.

__,_._,___

[MS_AccessPros] Concatenating names in a group.

 

I have a dataset that includes 'ClubName' and 'Group'.

GroupID ClubName
1 Club 1
2 Club 7
1 Club 11
2 Club 17
1 Club 21
2 Club 37

and so on.

Clubs are arranged in groups and I need a query that gives me a
result like this in two fields:

Group One - Club 1; Club 2; Club 3; etc
Group Two - Club 22; Club 27; Club 40; etc

Many thanks,

Robin Chapple

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

[AccessDevelopers] File - Monthly_Notices.txt

 


Monthly notices:

Hi Kids!:

Don't forget to check out our "Links" section at the website for helpful sites. Also take a peek at books that others have found worthwhile in our books database under the 'Database' link of the main AccessDevelopers page. Feel free to add any books or links that you have found useful.

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (107)
Recent Activity:

Please zip all files prior to uploading to Files section.
.

__,_._,___