From newsgrps at dalyn.co.nz Wed Jan 3 22:49:50 2018 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 4 Jan 2018 17:49:50 +1300 Subject: [AccessD] OpenDatabase error with linked table Message-ID: <00a901d38517$74a579a0$5df06ce0$@dalyn.co.nz> I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect, 11)) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Sched Data.mdb" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From gustav at cactus.dk Thu Jan 4 01:24:09 2018 From: gustav at cactus.dk (Gustav Brock) Date: Thu, 4 Jan 2018 07:24:09 +0000 Subject: [AccessD] OpenDatabase error with linked table Message-ID: Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect, 11)) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Sched Data.mdb" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From newsgrps at dalyn.co.nz Thu Jan 4 02:41:51 2018 From: newsgrps at dalyn.co.nz (David Emerson) Date: Thu, 4 Jan 2018 21:41:51 +1300 Subject: [AccessD] OpenDatabase error with linked table In-Reply-To: References: Message-ID: <00e101d38537$de6ff110$9b4fd330$@dalyn.co.nz> 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Sched Data.mdb" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From gustav at cactus.dk Thu Jan 4 03:03:55 2018 From: gustav at cactus.dk (Gustav Brock) Date: Thu, 4 Jan 2018 09:03:55 +0000 Subject: [AccessD] OpenDatabase error with linked table Message-ID: Hi David If I bing that, a whole page of options are listed, for example: https://support.microsoft.com/en-us/help/319844/you-receive-a-activex-component-can-t-create-object-error-message-when /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 09:42 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Sched Data.mdb" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From newsgrps at dalyn.co.nz Thu Jan 4 13:08:29 2018 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 5 Jan 2018 08:08:29 +1300 Subject: [AccessD] OpenDatabase error with linked table In-Reply-To: References: Message-ID: <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> Further information, Prior to this the database had the tables in the same file. The line read: Set lmdb_Exceptions = CurrentDB Everything worked fine. Noqw with the tables in a separate database I am getting the error. I am thinking perhaps a trusted location problem? David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 10:04 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David If I bing that, a whole page of options are listed, for example: https://support.microsoft.com/en-us/help/319844/you-receive-a-activex-compon ent-can-t-create-object-error-message-when /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 09:42 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Sched Data.mdb" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From gustav at cactus.dk Thu Jan 4 15:05:38 2018 From: gustav at cactus.dk (Gustav Brock) Date: Thu, 4 Jan 2018 21:05:38 +0000 Subject: [AccessD] OpenDatabase error with linked table In-Reply-To: <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> References: , <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> Message-ID: Hi David That you could easily check by copying the database to a trusted location on your own machine. /gustav ________________________________________ Fra: AccessD p? vegne af David Emerson Sendt: 4. januar 2018 20:08:29 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table Further information, Prior to this the database had the tables in the same file. The line read: Set lmdb_Exceptions = CurrentDB Everything worked fine. Noqw with the tables in a separate database I am getting the error. I am thinking perhaps a trusted location problem? David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 10:04 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David If I bing that, a whole page of options are listed, for example: https://support.microsoft.com/en-us/help/319844/you-receive-a-activex-compon ent-can-t-create-object-error-message-when /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 09:42 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Sched Data.mdb" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Lambert.Heenan at aig.com Fri Jan 5 08:28:50 2018 From: Lambert.Heenan at aig.com (Heenan, Lambert) Date: Fri, 5 Jan 2018 14:28:50 +0000 Subject: [AccessD] OpenDatabase error with linked table In-Reply-To: <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> References: <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> Message-ID: Does this help... https://support.microsoft.com/en-us/help/319844/you-receive-a-activex-component-can-t-create-object-error-message-when Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, January 04, 2018 2:08 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Further information, Prior to this the database had the tables in the same file. The line read: Set lmdb_Exceptions = CurrentDB Everything worked fine. Noqw with the tables in a separate database I am getting the error. I am thinking perhaps a trusted location problem? David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 10:04 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David If I bing that, a whole page of options are listed, for example: https://urldefense.proofpoint.com/v2/url?u=https-3A__support.microsoft.com_en-2Dus_help_319844_you-2Dreceive-2Da-2Dactivex-2Dcompon&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=D8h9OGYkpy3YijGad5CNb-D_HdlcI--Uq1kO95KrOqs&e= ent-can-t-create-object-error-message-when /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 09:42 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Schedhttps://urldefense.proofpoint.com/v2/url?u=http-3A__Data.md&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=0e68P5gEkqObEgHcaPLuyINMcGXyFDBWFvOeeRsX1Hw&e= b" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com https://urldefense.proofpoint.com/v2/url?u=http-3A__databaseadvisors.com_mailman_listinfo_accessd&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=DBYTF_2w0wEzeZgmD53ZWETPvraYucXiQxLWS6cKNrI&e= Website: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.databaseadvisors.com&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=Hyr6evHOvoTJSbJw-c3-0RBTn7h9wLtm8usyBuI8zSo&e= -- AccessD mailing list AccessD at databaseadvisors.com https://urldefense.proofpoint.com/v2/url?u=http-3A__databaseadvisors.com_mailman_listinfo_accessd&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=DBYTF_2w0wEzeZgmD53ZWETPvraYucXiQxLWS6cKNrI&e= Website: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.databaseadvisors.com&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=Hyr6evHOvoTJSbJw-c3-0RBTn7h9wLtm8usyBuI8zSo&e= From newsgrps at dalyn.co.nz Fri Jan 5 17:42:24 2018 From: newsgrps at dalyn.co.nz (David Emerson) Date: Sat, 6 Jan 2018 12:42:24 +1300 Subject: [AccessD] OpenDatabase error with linked table In-Reply-To: References: <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> Message-ID: <000601d3867e$d6fc5a20$84f50e60$@dalyn.co.nz> Thanks for replying Lambert. That is the same link as Gustav's. I am testing some ideas today. David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Saturday, 6 January 2018 3:29 a.m. To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Does this help... https://support.microsoft.com/en-us/help/319844/you-receive-a-activex-compon ent-can-t-create-object-error-message-when Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, January 04, 2018 2:08 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Further information, Prior to this the database had the tables in the same file. The line read: Set lmdb_Exceptions = CurrentDB Everything worked fine. Noqw with the tables in a separate database I am getting the error. I am thinking perhaps a trusted location problem? David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 10:04 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David If I bing that, a whole page of options are listed, for example: https://urldefense.proofpoint.com/v2/url?u=https-3A__support.microsoft.com_e n-2Dus_help_319844_you-2Dreceive-2Da-2Dactivex-2Dcompon&d=DwIFAw&c=kn4_INW_m BCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJ tnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=D8h9OGYkpy3YijGad5CNb-D _HdlcI--Uq1kO95KrOqs&e= ent-can-t-create-object-error-message-when /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 09:42 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Schedhttps://urldefense.proofpoint.com/v2/url?u=http-3A__Data.md&d=DwIFAw&c= kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3N CFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=0e68P5gEkqObEg HcaPLuyINMcGXyFDBWFvOeeRsX1Hw&e= b" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com https://urldefense.proofpoint.com/v2/url?u=http-3A__databaseadvisors.com_mai lman_listinfo_accessd&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0 ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1K oJD6MPeSGkPkH590&s=DBYTF_2w0wEzeZgmD53ZWETPvraYucXiQxLWS6cKNrI&e= Website: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.databaseadvisors.com &d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXd A5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=Hy r6evHOvoTJSbJw-c3-0RBTn7h9wLtm8usyBuI8zSo&e= -- AccessD mailing list AccessD at databaseadvisors.com https://urldefense.proofpoint.com/v2/url?u=http-3A__databaseadvisors.com_mai lman_listinfo_accessd&d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0 ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1K oJD6MPeSGkPkH590&s=DBYTF_2w0wEzeZgmD53ZWETPvraYucXiQxLWS6cKNrI&e= Website: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.databaseadvisors.com &d=DwIFAw&c=kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXd A5D1EN8y5q3NCFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=Hy r6evHOvoTJSbJw-c3-0RBTn7h9wLtm8usyBuI8zSo&e= -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Fri Jan 5 20:50:57 2018 From: newsgrps at dalyn.co.nz (David Emerson) Date: Sat, 6 Jan 2018 15:50:57 +1300 Subject: [AccessD] OpenDatabase error with linked table In-Reply-To: <000601d3867e$d6fc5a20$84f50e60$@dalyn.co.nz> References: <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> <000601d3867e$d6fc5a20$84f50e60$@dalyn.co.nz> Message-ID: <000d01d38699$2dfe86d0$89fb9470$@dalyn.co.nz> Didn't seem to be trusted file problem as I was able to copy it to a local folder with the same problems. Ended up replacing the code with this: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = CurrentDB Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException") In summary, I reverted back to the current database and removed the ", dbOpenTable" from the end of the OpenRecordset line. I then deleted ant index references and changed Seek to Findfirst. Seems to have worked. Didn't explain the problem but at least the client can continue using the programme. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Saturday, 6 January 2018 12:42 p.m. To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Thanks for replying Lambert. That is the same link as Gustav's. I am testing some ideas today. David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Saturday, 6 January 2018 3:29 a.m. To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Does this help... https://support.microsoft.com/en-us/help/319844/you-receive-a-activex-compon ent-can-t-create-object-error-message-when Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, January 04, 2018 2:08 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Further information, Prior to this the database had the tables in the same file. The line read: Set lmdb_Exceptions = CurrentDB Everything worked fine. Noqw with the tables in a separate database I am getting the error. I am thinking perhaps a trusted location problem? David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 10:04 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David If I bing that, a whole page of options are listed, for example: https://urldefense.proofpoint.com/v2/url?u=https-3A__support.microsoft.com_e n-2Dus_help_319844_you-2Dreceive-2Da-2Dactivex-2Dcompon&d=DwIFAw&c=kn4_INW_m BCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJ tnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=D8h9OGYkpy3YijGad5CNb-D _HdlcI--Uq1kO95KrOqs&e= ent-can-t-create-object-error-message-when /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 09:42 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Schedhttps://urldefense.proofpoint.com/v2/url?u=http-3A__Data.md&d=DwIFAw&c= kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3N CFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=0e68P5gEkqObEg HcaPLuyINMcGXyFDBWFvOeeRsX1Hw&e= b" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From accessd at shaw.ca Sat Jan 6 13:04:32 2018 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 6 Jan 2018 12:04:32 -0700 (MST) Subject: [AccessD] OpenDatabase error with linked table In-Reply-To: <000d01d38699$2dfe86d0$89fb9470$@dalyn.co.nz> References: <000f01d3858f$68519170$38f4b450$@dalyn.co.nz> <000601d3867e$d6fc5a20$84f50e60$@dalyn.co.nz> <000d01d38699$2dfe86d0$89fb9470$@dalyn.co.nz> Message-ID: <709196137.196223010.1515265472608.JavaMail.zimbra@shaw.ca> Great detective work and subsequent solution. Jim ----- Original Message ----- From: "David Emerson" To: "Access Developers discussion and problem solving" Sent: Friday, January 5, 2018 6:50:57 PM Subject: Re: [AccessD] OpenDatabase error with linked table Didn't seem to be trusted file problem as I was able to copy it to a local folder with the same problems. Ended up replacing the code with this: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = CurrentDB Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException") In summary, I reverted back to the current database and removed the ", dbOpenTable" from the end of the OpenRecordset line. I then deleted ant index references and changed Seek to Findfirst. Seems to have worked. Didn't explain the problem but at least the client can continue using the programme. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Saturday, 6 January 2018 12:42 p.m. To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Thanks for replying Lambert. That is the same link as Gustav's. I am testing some ideas today. David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Saturday, 6 January 2018 3:29 a.m. To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Does this help... https://support.microsoft.com/en-us/help/319844/you-receive-a-activex-compon ent-can-t-create-object-error-message-when Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, January 04, 2018 2:08 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OpenDatabase error with linked table Further information, Prior to this the database had the tables in the same file. The line read: Set lmdb_Exceptions = CurrentDB Everything worked fine. Noqw with the tables in a separate database I am getting the error. I am thinking perhaps a trusted location problem? David -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 10:04 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David If I bing that, a whole page of options are listed, for example: https://urldefense.proofpoint.com/v2/url?u=https-3A__support.microsoft.com_e n-2Dus_help_319844_you-2Dreceive-2Da-2Dactivex-2Dcompon&d=DwIFAw&c=kn4_INW_m BCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3NCFsL309SJ tnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=D8h9OGYkpy3YijGad5CNb-D _HdlcI--Uq1kO95KrOqs&e= ent-can-t-create-object-error-message-when /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 09:42 Til: 'Access Developers discussion and problem solving' Emne: Re: [AccessD] OpenDatabase error with linked table 429 - "ActiveX Component can't create object.". It stops on the line indicated below. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, 4 January 2018 8:24 p.m. To: Access Developers discussion and problem solving Subject: Re: [AccessD] OpenDatabase error with linked table Hi David It should work. What is the error? /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af David Emerson Sendt: 4. januar 2018 05:50 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] OpenDatabase error with linked table I have the following lines in code: Dim lmdb_Exceptions As dao.Database Dim lrds_Exception_Records As dao.Recordset 'Setup Recordset for Capacity Exception table Set lmdb_Exceptions = OpenDatabase(Mid(DBEngine(0)(0).TableDefs("tblCapacityException").Connect,11 )) <-- Error here Set lrds_Exception_Records = lmdb_Exceptions.OpenRecordset("tblCapacityException", dbOpenTable) lrds_Exception_Records.Index = "CapacityExceptionDate" 'Set Index for dynaset In the OpenDatabase line I get an error that "ActiveX Component can't create object." tblCapacityException is a linked table. DBEngine(0)(0).TableDefs("tblCapacityException").Connect = ";DATABASE=\\PDS-SRV\ProdSched\Prod Schedhttps://urldefense.proofpoint.com/v2/url?u=http-3A__Data.md&d=DwIFAw&c= kn4_INW_mBCDHV_xJEVJkg&r=pQuzU2JPOWFA8d1LR0ScRkf41KAmO3vze52XDXdA5D1EN8y5q3N CFsL309SJtnkO&m=o1aojNqiPVx-RxhtgBPIHRfYh1KoJD6MPeSGkPkH590&s=0e68P5gEkqObEg HcaPLuyINMcGXyFDBWFvOeeRsX1Hw&e= b" I have read that I need to connect directly with the table database to use the Index property. This is a legacy program. Any suggested improvements on how to achieve this would be appreciated. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sun Jan 7 19:33:14 2018 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 7 Jan 2018 17:33:14 -0800 Subject: [AccessD] Excel Automation Questions Message-ID: <059a01d38820$a725f510$f571df30$@bchacc.com> Dear List(s): I have a client who wants a custom Excel spreadsheet exported from his Access data. There is one field which can get quite long and in the report it's easy - the field width is set in the design view and the Can Grow is set to yes. So the row height changes with the height of that text box. Normally when I automate a custom spreadsheet from Access I issue the command on VBA which sets all the field widths to the longest data of any record for that field. In this case, however, there may be 300 characters or more in the exported field, so I need to set that field to a specific width, like 3 inches or so, and set the field to wrap text. However, the height of that specific row would need to be changed to accommodate/show all those characters. But I don't want to set ALL the rows to a height which will accommodate the largest number of rows of any record. So.is there a way in Excel to accomplish this - to automagically set the height of a row to accommodate the largest number of lines in a field in that row? If so, I can figure out how to do it in VBA by recording a macro. MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin From newsgrps at dalyn.co.nz Sun Jan 7 21:23:49 2018 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 8 Jan 2018 16:23:49 +1300 Subject: [AccessD] Excel Automation Questions In-Reply-To: <059a01d38820$a725f510$f571df30$@bchacc.com> References: <059a01d38820$a725f510$f571df30$@bchacc.com> Message-ID: <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> Hi Rocky, Try: xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:33 p.m. To: 'Access Developers discussion and problem solving' Subject: [AccessD] Excel Automation Questions Dear List(s): I have a client who wants a custom Excel spreadsheet exported from his Access data. There is one field which can get quite long and in the report it's easy - the field width is set in the design view and the Can Grow is set to yes. So the row height changes with the height of that text box. Normally when I automate a custom spreadsheet from Access I issue the command on VBA which sets all the field widths to the longest data of any record for that field. In this case, however, there may be 300 characters or more in the exported field, so I need to set that field to a specific width, like 3 inches or so, and set the field to wrap text. However, the height of that specific row would need to be changed to accommodate/show all those characters. But I don't want to set ALL the rows to a height which will accommodate the largest number of rows of any record. So.is there a way in Excel to accomplish this - to automagically set the height of a row to accommodate the largest number of lines in a field in that row? If so, I can figure out how to do it in VBA by recording a macro. MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sun Jan 7 21:41:23 2018 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 7 Jan 2018 19:41:23 -0800 Subject: [AccessD] Excel Automation Questions In-Reply-To: <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> References: <059a01d38820$a725f510$f571df30$@bchacc.com> <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> Message-ID: <05a901d38832$8e4eaf20$aaec0d60$@bchacc.com> Thanks. I'll try it. Looks promising. What's the "7" for? What's in intRow? R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Sunday, January 07, 2018 7:24 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Hi Rocky, Try: xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:33 p.m. To: 'Access Developers discussion and problem solving' Subject: [AccessD] Excel Automation Questions Dear List(s): I have a client who wants a custom Excel spreadsheet exported from his Access data. There is one field which can get quite long and in the report it's easy - the field width is set in the design view and the Can Grow is set to yes. So the row height changes with the height of that text box. Normally when I automate a custom spreadsheet from Access I issue the command on VBA which sets all the field widths to the longest data of any record for that field. In this case, however, there may be 300 characters or more in the exported field, so I need to set that field to a specific width, like 3 inches or so, and set the field to wrap text. However, the height of that specific row would need to be changed to accommodate/show all those characters. But I don't want to set ALL the rows to a height which will accommodate the largest number of rows of any record. So.is there a way in Excel to accomplish this - to automagically set the height of a row to accommodate the largest number of lines in a field in that row? If so, I can figure out how to do it in VBA by recording a macro. MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From darryl at whittleconsulting.com.au Sun Jan 7 22:00:46 2018 From: darryl at whittleconsulting.com.au (Darryl Collins) Date: Mon, 8 Jan 2018 04:00:46 +0000 Subject: [AccessD] Excel Automation Questions In-Reply-To: <05a901d38832$8e4eaf20$aaec0d60$@bchacc.com> References: <059a01d38820$a725f510$f571df30$@bchacc.com> <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> <05a901d38832$8e4eaf20$aaec0d60$@bchacc.com> Message-ID: Seven would be the first/top row (mod to suit I would think). intRow would be the last row Again you could mod/determine the last row in a few way. If you need help with Excel, let me know or ask on Excel-L Or if you know what they are and they don't more you can hard code them (Clearly 7 is already hard coded). Cheers Darryl. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:41 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Thanks. I'll try it. Looks promising. What's the "7" for? What's in intRow? R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Sunday, January 07, 2018 7:24 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Hi Rocky, Try: xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:33 p.m. To: 'Access Developers discussion and problem solving' Subject: [AccessD] Excel Automation Questions Dear List(s): I have a client who wants a custom Excel spreadsheet exported from his Access data. There is one field which can get quite long and in the report it's easy - the field width is set in the design view and the Can Grow is set to yes. So the row height changes with the height of that text box. Normally when I automate a custom spreadsheet from Access I issue the command on VBA which sets all the field widths to the longest data of any record for that field. In this case, however, there may be 300 characters or more in the exported field, so I need to set that field to a specific width, like 3 inches or so, and set the field to wrap text. However, the height of that specific row would need to be changed to accommodate/show all those characters. But I don't want to set ALL the rows to a height which will accommodate the largest number of rows of any record. So.is there a way in Excel to accomplish this - to automagically set the height of a row to accommodate the largest number of lines in a field in that row? If so, I can figure out how to do it in VBA by recording a macro. MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sun Jan 7 22:03:59 2018 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 7 Jan 2018 20:03:59 -0800 Subject: [AccessD] Excel Automation Questions In-Reply-To: References: <059a01d38820$a725f510$f571df30$@bchacc.com> <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> <05a901d38832$8e4eaf20$aaec0d60$@bchacc.com> Message-ID: <05b301d38835$b67d3720$2377a560$@bchacc.com> Got it. I usually find these things by recording a macro. Works every time. :) R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl Collins Sent: Sunday, January 07, 2018 8:01 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Excel Automation Questions Seven would be the first/top row (mod to suit I would think). intRow would be the last row Again you could mod/determine the last row in a few way. If you need help with Excel, let me know or ask on Excel-L Or if you know what they are and they don't more you can hard code them (Clearly 7 is already hard coded). Cheers Darryl. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:41 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Thanks. I'll try it. Looks promising. What's the "7" for? What's in intRow? R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Sunday, January 07, 2018 7:24 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Hi Rocky, Try: xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:33 p.m. To: 'Access Developers discussion and problem solving' Subject: [AccessD] Excel Automation Questions Dear List(s): I have a client who wants a custom Excel spreadsheet exported from his Access data. There is one field which can get quite long and in the report it's easy - the field width is set in the design view and the Can Grow is set to yes. So the row height changes with the height of that text box. Normally when I automate a custom spreadsheet from Access I issue the command on VBA which sets all the field widths to the longest data of any record for that field. In this case, however, there may be 300 characters or more in the exported field, so I need to set that field to a specific width, like 3 inches or so, and set the field to wrap text. However, the height of that specific row would need to be changed to accommodate/show all those characters. But I don't want to set ALL the rows to a height which will accommodate the largest number of rows of any record. So.is there a way in Excel to accomplish this - to automagically set the height of a row to accommodate the largest number of lines in a field in that row? If so, I can figure out how to do it in VBA by recording a macro. MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From darryl at whittleconsulting.com.au Sun Jan 7 22:43:25 2018 From: darryl at whittleconsulting.com.au (Darryl Collins) Date: Mon, 8 Jan 2018 04:43:25 +0000 Subject: [AccessD] Excel Automation Questions In-Reply-To: <05b301d38835$b67d3720$2377a560$@bchacc.com> References: <059a01d38820$a725f510$f571df30$@bchacc.com> <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> <05a901d38832$8e4eaf20$aaec0d60$@bchacc.com> <05b301d38835$b67d3720$2377a560$@bchacc.com> Message-ID: Yes, the Macro Recorder is pure genius. The code it produces is usually fairly ugly and lacks any brevity and/or style, but it is nearly always enough to get you over the line if you are stuck. Plenty of us first learnt to code thanks to the recorder. Kudos to those early MS coders who put it into Excel. ? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 3:04 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Got it. I usually find these things by recording a macro. Works every time. :) R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl Collins Sent: Sunday, January 07, 2018 8:01 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Excel Automation Questions Seven would be the first/top row (mod to suit I would think). intRow would be the last row Again you could mod/determine the last row in a few way. If you need help with Excel, let me know or ask on Excel-L Or if you know what they are and they don't more you can hard code them (Clearly 7 is already hard coded). Cheers Darryl. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:41 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Thanks. I'll try it. Looks promising. What's the "7" for? What's in intRow? R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Sunday, January 07, 2018 7:24 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Hi Rocky, Try: xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:33 p.m. To: 'Access Developers discussion and problem solving' Subject: [AccessD] Excel Automation Questions Dear List(s): I have a client who wants a custom Excel spreadsheet exported from his Access data. There is one field which can get quite long and in the report it's easy - the field width is set in the design view and the Can Grow is set to yes. So the row height changes with the height of that text box. Normally when I automate a custom spreadsheet from Access I issue the command on VBA which sets all the field widths to the longest data of any record for that field. In this case, however, there may be 300 characters or more in the exported field, so I need to set that field to a specific width, like 3 inches or so, and set the field to wrap text. However, the height of that specific row would need to be changed to accommodate/show all those characters. But I don't want to set ALL the rows to a height which will accommodate the largest number of rows of any record. So.is there a way in Excel to accomplish this - to automagically set the height of a row to accommodate the largest number of lines in a field in that row? If so, I can figure out how to do it in VBA by recording a macro. MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Mon Jan 8 08:30:58 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Mon, 8 Jan 2018 14:30:58 +0000 Subject: [AccessD] Query problem in VBA Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1CA77@HOUEX11.kindermorgan.com> The following query runs fine when executed from the design window or query list. When I try to run it from vba it complains about a missing parameter. When It runs in code is it not picking up the list box value? Thanks for any assistance. SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=[Forms]![Form1]![PIH_Date_List])); From gustav at cactus.dk Mon Jan 8 08:58:43 2018 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 8 Jan 2018 14:58:43 +0000 Subject: [AccessD] Query problem in VBA Message-ID: Hi Chester In VBA, the SQL doesn't know about the form. The easy workaround is a small helper function: Public Function GetDateListMonth() GetDateListMonth = [Forms]![Form1]![PIH_Date_List].Value End Function And then use this: SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING PIH_Monthly_Allocated_Volumes.ProductionMonth = GetDateListMonth() /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Kaup, Chester Sendt: 8. januar 2018 15:31 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] Query problem in VBA The following query runs fine when executed from the design window or query list. When I try to run it from vba it complains about a missing parameter. When It runs in code is it not picking up the list box value? Thanks for any assistance. SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=[Forms]![Form1]![PIH_Date_List])); From jimdettman at verizon.net Mon Jan 8 10:48:22 2018 From: jimdettman at verizon.net (Jim Dettman) Date: Mon, 8 Jan 2018 11:48:22 -0500 Subject: [AccessD] Query problem in VBA In-Reply-To: References: Message-ID: <0cd101d388a0$8006f1c0$8014d540$@verizon.net> Or you can do: SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=Eval([Forms]![Form1]![PIH_ Date_List]))); Or you can open the querydef (or create one) and assign the parameter value directly: Dim db As Database Dim qdf As QueryDef Dim rs As Recordset Set db = CurDb() Set qdf = db.QueryDefs("myQuery") qdf.Parameters(0) = Eval(qdf.Parameters(0).Name) Set rs = qdf.OpenRecordset() Or in a loop if you had more than one: Dim prm as Parameter For Each prm in qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rs = qdf.OpenRecordset() Eval() works because the name of the parameter is a valid reference. Or set the SQL string on the fly with the actual value: strSQL = " SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)= & [Forms]![Form1]![PIH_Date_List] & "));" Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, January 08, 2018 09:59 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query problem in VBA Hi Chester In VBA, the SQL doesn't know about the form. The easy workaround is a small helper function: Public Function GetDateListMonth() GetDateListMonth = [Forms]![Form1]![PIH_Date_List].Value End Function And then use this: SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING PIH_Monthly_Allocated_Volumes.ProductionMonth = GetDateListMonth() /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Kaup, Chester Sendt: 8. januar 2018 15:31 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] Query problem in VBA The following query runs fine when executed from the design window or query list. When I try to run it from vba it complains about a missing parameter. When It runs in code is it not picking up the list box value? Thanks for any assistance. SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=[Forms]![Form1]![PIH_Date_ List])); -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Mon Jan 8 10:52:00 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Mon, 8 Jan 2018 16:52:00 +0000 Subject: [AccessD] Query problem in VBA In-Reply-To: <0cd101d388a0$8006f1c0$8014d540$@verizon.net> References: <0cd101d388a0$8006f1c0$8014d540$@verizon.net> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1DCB0@HOUEX11.kindermorgan.com> Thank you everyone for your suggestions. Problem solved. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Monday, January 08, 2018 10:48 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Query problem in VBA [This email message was received from the Internet and came from outside of Kinder Morgan] Or you can do: SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=Eval([Forms]![Form1]![PIH_ Date_List]))); Or you can open the querydef (or create one) and assign the parameter value directly: Dim db As Database Dim qdf As QueryDef Dim rs As Recordset Set db = CurDb() Set qdf = db.QueryDefs("myQuery") qdf.Parameters(0) = Eval(qdf.Parameters(0).Name) Set rs = qdf.OpenRecordset() Or in a loop if you had more than one: Dim prm as Parameter For Each prm in qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rs = qdf.OpenRecordset() Eval() works because the name of the parameter is a valid reference. Or set the SQL string on the fly with the actual value: strSQL = " SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)= & [Forms]![Form1]![PIH_Date_List] & "));" Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, January 08, 2018 09:59 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query problem in VBA Hi Chester In VBA, the SQL doesn't know about the form. The easy workaround is a small helper function: Public Function GetDateListMonth() GetDateListMonth = [Forms]![Form1]![PIH_Date_List].Value End Function And then use this: SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING PIH_Monthly_Allocated_Volumes.ProductionMonth = GetDateListMonth() /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Kaup, Chester Sendt: 8. januar 2018 15:31 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] Query problem in VBA The following query runs fine when executed from the design window or query list. When I try to run it from vba it complains about a missing parameter. When It runs in code is it not picking up the list box value? Thanks for any assistance. SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=[Forms]![Form1]![PIH_Date_ List])); -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Mon Jan 8 13:33:32 2018 From: bensonforums at gmail.com (Bill Benson) Date: Mon, 8 Jan 2018 14:33:32 -0500 Subject: [AccessD] Query problem in VBA In-Reply-To: <0cd101d388a0$8006f1c0$8014d540$@verizon.net> References: <0cd101d388a0$8006f1c0$8014d540$@verizon.net> Message-ID: Jim, doesn't the parameters collection require a refresh when setting? Or is that only when parameters are being added at runtime? On Mon, Jan 8, 2018 at 11:48 AM, Jim Dettman wrote: > > Or you can do: > > SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, > Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly > Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY > PIH_Monthly_Allocated_Volumes.ProductionMonth > HAVING > (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=Eval( > [Forms]![Form1]![PIH_ > Date_List]))); > > Or you can open the querydef (or create one) and assign the parameter > value > directly: > > Dim db As Database > Dim qdf As QueryDef > Dim rs As Recordset > > > Set db = CurDb() > Set qdf = db.QueryDefs("myQuery") > qdf.Parameters(0) = Eval(qdf.Parameters(0).Name) > Set rs = qdf.OpenRecordset() > > Or in a loop if you had more than one: > > Dim prm as Parameter > > For Each prm in qdf.Parameters > prm.Value = Eval(prm.Name) > Next prm > Set rs = qdf.OpenRecordset() > > Eval() works because the name of the parameter is a valid reference. > > Or set the SQL string on the fly with the actual value: > > strSQL = " SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, > Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly > Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY > PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING > (((PIH_Monthly_Allocated_Volumes.ProductionMonth)= & > [Forms]![Form1]![PIH_Date_List] & "));" > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Gustav Brock > Sent: Monday, January 08, 2018 09:59 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query problem in VBA > > Hi Chester > > In VBA, the SQL doesn't know about the form. > > The easy workaround is a small helper function: > > Public Function GetDateListMonth() > GetDateListMonth = [Forms]![Form1]![PIH_Date_List].Value > End Function > > And then use this: > > SELECT > PIH_Monthly_Allocated_Volumes.ProductionMonth, > Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil > INTO > [tbl PIH Monthly Oil] > FROM > PIH_Monthly_Allocated_Volumes > GROUP BY > PIH_Monthly_Allocated_Volumes.ProductionMonth > HAVING > PIH_Monthly_Allocated_Volumes.ProductionMonth = GetDateListMonth() > > /gustav > > -----Oprindelig meddelelse----- > Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af > Kaup, > Chester > Sendt: 8. januar 2018 15:31 > Til: 'Access Developers discussion and problem solving' > > Emne: [AccessD] Query problem in VBA > > The following query runs fine when executed from the design window or query > list. When I try to run it from vba it complains about a missing parameter. > When It runs in code is it not picking up the list box value? Thanks for > any > assistance. > > SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, > Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly > Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY > PIH_Monthly_Allocated_Volumes.ProductionMonth > HAVING > (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=[ > Forms]![Form1]![PIH_Date_ > List])); > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From accessd at shaw.ca Mon Jan 8 15:12:31 2018 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 8 Jan 2018 14:12:31 -0700 (MST) Subject: [AccessD] Query problem in VBA In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1CA77@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1CA77@HOUEX11.kindermorgan.com> Message-ID: <297463700.201442476.1515445951045.JavaMail.zimbra@shaw.ca> Just off the cuff...I do not trust the reliability of Form variables especially in complex queries. In your situation, if this problem continues try using a compound query...one query assembling the core data and next query applying just to the core data results. If necessary the results can be generated layer by layer. Regardless, this method is a good way isolate an intermittent problem. HTH Jim ----- Original Message ----- From: "Kaup, Chester" Kaup at kindermorgan.com> To: "Access Developers discussion and problem solving" Sent: Monday, January 8, 2018 6:30:58 AM Subject: [AccessD] Query problem in VBA The following query runs fine when executed from the design window or query list. When I try to run it from vba it complains about a missing parameter. When It runs in code is it not picking up the list box value? Thanks for any assistance. SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=[Forms]![Form1]![PIH_Date_List])); -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at gmail.com Mon Jan 8 15:15:28 2018 From: jwcolby at gmail.com (John Colby) Date: Mon, 8 Jan 2018 16:15:28 -0500 Subject: [AccessD] Excel Automation Questions In-Reply-To: <05b301d38835$b67d3720$2377a560$@bchacc.com> References: <059a01d38820$a725f510$f571df30$@bchacc.com> <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> <05a901d38832$8e4eaf20$aaec0d60$@bchacc.com> <05b301d38835$b67d3720$2377a560$@bchacc.com> Message-ID: me too. :) On 1/7/2018 11:03 PM, Rocky Smolin wrote: > Got it. I usually find these things by recording a macro. Works every > time. :) > > R > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Darryl Collins > Sent: Sunday, January 07, 2018 8:01 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Excel Automation Questions > > Seven would be the first/top row (mod to suit I would think). > > intRow would be the last row > > Again you could mod/determine the last row in a few way. > If you need help with Excel, let me know or ask on Excel-L > > Or if you know what they are and they don't more you can hard code them > (Clearly 7 is already hard coded). > > > > Cheers > Darryl. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Rocky Smolin > Sent: Monday, 8 January 2018 2:41 PM > To: 'Access Developers discussion and problem solving' > > Subject: Re: [AccessD] Excel Automation Questions > > > Thanks. I'll try it. Looks promising. What's the "7" for? What's in > intRow? > > R > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > David Emerson > Sent: Sunday, January 07, 2018 7:24 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Excel Automation Questions > > Hi Rocky, > > Try: > xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit > > Regards > > David Emerson > Dalyn Software Ltd > Wellington, New Zealand > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Rocky Smolin > Sent: Monday, 8 January 2018 2:33 p.m. > To: 'Access Developers discussion and problem solving' > Subject: [AccessD] Excel Automation Questions > > Dear List(s): > > > > I have a client who wants a custom Excel spreadsheet exported from his > Access data. There is one field which can get quite long and in the report > it's easy - the field width is set in the design view and the Can Grow is > set to yes. So the row height changes with the height of that text box. > > > > Normally when I automate a custom spreadsheet from Access I issue the > command on VBA which sets all the field widths to the longest data of any > record for that field. In this case, however, there may be 300 characters > or more in the exported field, so I need to set that field to a specific > width, like 3 inches or so, and set the field to wrap text. > > > > However, the height of that specific row would need to be changed to > accommodate/show all those characters. But I don't want to set ALL the rows > to a height which will accommodate the largest number of rows of any record. > > > > So.is there a way in Excel to accomplish this - to automagically set the > height of a row to accommodate the largest number of lines in a field in > that row? If so, I can figure out how to do it in VBA by recording a macro. > > > > > MTIA > > > > Rocky Smolin > > Beach Access Software > > 760-683-5777 > > www.bchacc.com > > www.e-z-mrp.com > > Skype: rocky.smolin > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- John W. Colby From Chester_Kaup at kindermorgan.com Tue Jan 9 15:49:49 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 9 Jan 2018 21:49:49 +0000 Subject: [AccessD] Query runs and doesn't run Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> I have the following query that run just fine from the query grid SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND ((Allocations.Date)=#6/1/1935#)); I have the same query in VBA but it generates no output. I am at a loss as to what is going on. Here is the VBA part. Dim dbs As DAO.Database Set dbs = CurrentDb strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern Factors] " & _ "FROM Allocations " & _ "WHERE Allocations.PTYPE='PATT' AND Allocations.Date=#6/1/1935#;" dbs.Execute strSQL What is even stranger is the following statement does not fail although I do not see the table in the list of tables DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" From df.waters at outlook.com Tue Jan 9 16:10:43 2018 From: df.waters at outlook.com (Dan Waters) Date: Tue, 9 Jan 2018 22:10:43 +0000 Subject: [AccessD] Query problem in VBA In-Reply-To: <297463700.201442476.1515445951045.JavaMail.zimbra@shaw.ca> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1CA77@HOUEX11.kindermorgan.com> <297463700.201442476.1515445951045.JavaMail.zimbra@shaw.ca> Message-ID: I agree with not trusting form variables. Long ago I started setting the value of a standard variable to a form control value, and then used the standard variable in a query. Did seem to work better. stgPersonName = frmMainName.txtPersonName Then use stgPersonName in the query. Dan -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: January 8, 2018 15:13 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query problem in VBA Just off the cuff...I do not trust the reliability of Form variables especially in complex queries. In your situation, if this problem continues try using a compound query...one query assembling the core data and next query applying just to the core data results. If necessary the results can be generated layer by layer. Regardless, this method is a good way isolate an intermittent problem. HTH Jim ----- Original Message ----- From: "Kaup, Chester" Kaup at kindermorgan.com> To: "Access Developers discussion and problem solving" Sent: Monday, January 8, 2018 6:30:58 AM Subject: [AccessD] Query problem in VBA The following query runs fine when executed from the design window or query list. When I try to run it from vba it complains about a missing parameter. When It runs in code is it not picking up the list box value? Thanks for any assistance. SELECT PIH_Monthly_Allocated_Volumes.ProductionMonth, Sum(PIH_Monthly_Allocated_Volumes.Oil) AS SumOfOil INTO [tbl PIH Monthly Oil] FROM PIH_Monthly_Allocated_Volumes GROUP BY PIH_Monthly_Allocated_Volumes.ProductionMonth HAVING (((PIH_Monthly_Allocated_Volumes.ProductionMonth)=[Forms]![Form1]![PIH_Date_List])); -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Jan 9 16:21:27 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 9 Jan 2018 22:21:27 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E4AE@HOUEX11.kindermorgan.com> Well I did find one syntax error. Need two pairs of double quotes around PATT. Should have been ""PATT"". Still getting no results though. From: Kaup, Chester Sent: Tuesday, January 09, 2018 3:50 PM To: 'Access Developers discussion and problem solving' Subject: Query runs and doesn't run I have the following query that run just fine from the query grid SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND ((Allocations.Date)=#6/1/1935#)); I have the same query in VBA but it generates no output. I am at a loss as to what is going on. Here is the VBA part. Dim dbs As DAO.Database Set dbs = CurrentDb strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern Factors] " & _ "FROM Allocations " & _ "WHERE Allocations.PTYPE='PATT' AND Allocations.Date=#6/1/1935#;" dbs.Execute strSQL What is even stranger is the following statement does not fail although I do not see the table in the list of tables DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" From paul.hartland at googlemail.com Tue Jan 9 16:34:28 2018 From: paul.hartland at googlemail.com (Paul Hartland) Date: Tue, 9 Jan 2018 22:34:28 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E4AE@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E4AE@HOUEX11.kindermorgan.com> Message-ID: Have you tried running it without the where clause, then if it works try again with one of the where clauses, then the other....also when I used to query dates in access I would use something like the below, formatting the date Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" On 9 Jan 2018 22:23, "Kaup, Chester" wrote: > Well I did find one syntax error. Need two pairs of double quotes around > PATT. Should have been ""PATT"". Still getting no results though. > > From: Kaup, Chester > Sent: Tuesday, January 09, 2018 3:50 PM > To: 'Access Developers discussion and problem solving' > Subject: Query runs and doesn't run > > I have the following query that run just fine from the query grid > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, > Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, > Allocations.Factor_2 INTO [tbl Initial Pattern Factors] > FROM Allocations > WHERE (((Allocations.PTYPE)="PATT") AND ((Allocations.Date)=#6/1/1935#)); > > I have the same query in VBA but it generates no output. I am at a loss as > to what is going on. Here is the VBA part. > > Dim dbs As DAO.Database > Set dbs = CurrentDb > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > Allocations.PID, Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, > Allocations.Factor_2 INTO [tbl Initial Pattern Factors] " & _ > "FROM Allocations " & _ > "WHERE Allocations.PTYPE='PATT' AND > Allocations.Date=#6/1/1935#;" > > dbs.Execute strSQL > > > What is even stranger is the following statement does not fail although I > do not see the table in the list of tables > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DMcGillivray at ctc.ca.gov Tue Jan 9 17:17:31 2018 From: DMcGillivray at ctc.ca.gov (McGillivray, Don) Date: Tue, 9 Jan 2018 23:17:31 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E4AE@HOUEX11.kindermorgan.com> Message-ID: <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> I'm pretty sure that "dbs.execute" requires an action query (INSERT, UPDATE, DELETE). Won't work with a SELECT. If you think about it, that makes sense; what do you expect to happen with the results of that SELECT in your code? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM To: Access List Cc: Paul Hartland Subject: Re: [AccessD] Query runs and doesn't run Have you tried running it without the where clause, then if it works try again with one of the where clauses, then the other....also when I used to query dates in access I would use something like the below, formatting the date Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" On 9 Jan 2018 22:23, "Kaup, Chester" wrote: > Well I did find one syntax error. Need two pairs of double quotes > around PATT. Should have been ""PATT"". Still getting no results though. > > From: Kaup, Chester > Sent: Tuesday, January 09, 2018 3:50 PM > To: 'Access Developers discussion and problem solving' > Subject: Query runs and doesn't run > > I have the following query that run just fine from the query grid > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, > Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, > Allocations.Factor_2 INTO [tbl Initial Pattern Factors] FROM > Allocations WHERE (((Allocations.PTYPE)="PATT") AND > ((Allocations.Date)=#6/1/1935#)); > > I have the same query in VBA but it generates no output. I am at a > loss as to what is going on. Here is the VBA part. > > Dim dbs As DAO.Database > Set dbs = CurrentDb > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > Allocations.PID, Allocations.PTYPE, Allocations.Date, > Allocations.Factor_1, > Allocations.Factor_2 INTO [tbl Initial Pattern Factors] " & _ > "FROM Allocations " & _ > "WHERE Allocations.PTYPE='PATT' AND > Allocations.Date=#6/1/1935#;" > > dbs.Execute strSQL > > > What is even stranger is the following statement does not fail > although I do not see the table in the list of tables > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Tue Jan 9 17:25:30 2018 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 9 Jan 2018 15:25:30 -0800 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E4AE@HOUEX11.kindermorgan.com> <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> Message-ID: How about (air code) instead of the dbs.execute strSQL: dim rs as dao.recordset set rs = currentdb.openrecordset strSQL do while not rs.eof (display data or whatever) rs.movenext loop On Tue, Jan 9, 2018 at 3:17 PM, McGillivray, Don wrote: > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > UPDATE, DELETE). Won't work with a SELECT. > > If you think about it, that makes sense; what do you expect to happen with > the results of that SELECT in your code? > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Paul Hartland via AccessD > Sent: Tuesday, January 09, 2018 2:34 PM > To: Access List > Cc: Paul Hartland > Subject: Re: [AccessD] Query runs and doesn't run > > Have you tried running it without the where clause, then if it works try > again with one of the where clauses, then the other....also when I used to > query dates in access I would use something like the below, formatting the > date > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > On 9 Jan 2018 22:23, "Kaup, Chester" > wrote: > > > Well I did find one syntax error. Need two pairs of double quotes > > around PATT. Should have been ""PATT"". Still getting no results though. > > > > From: Kaup, Chester > > Sent: Tuesday, January 09, 2018 3:50 PM > > To: 'Access Developers discussion and problem solving' > > Subject: Query runs and doesn't run > > > > I have the following query that run just fine from the query grid > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, > > Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, > > Allocations.Factor_2 INTO [tbl Initial Pattern Factors] FROM > > Allocations WHERE (((Allocations.PTYPE)="PATT") AND > > ((Allocations.Date)=#6/1/1935#)); > > > > I have the same query in VBA but it generates no output. I am at a > > loss as to what is going on. Here is the VBA part. > > > > Dim dbs As DAO.Database > > Set dbs = CurrentDb > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > Allocations.Factor_1, > > Allocations.Factor_2 INTO [tbl Initial Pattern Factors] " & _ > > "FROM Allocations " & _ > > "WHERE Allocations.PTYPE='PATT' AND > > Allocations.Date=#6/1/1935#;" > > > > dbs.Execute strSQL > > > > > > What is even stranger is the following statement does not fail > > although I do not see the table in the list of tables > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Tue Jan 9 18:18:33 2018 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 10 Jan 2018 10:18:33 +1000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com>, , <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> Message-ID: <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is failing. That is an action query. On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > UPDATE, DELETE). Won't work with a SELECT. > > If you think about it, that makes sense; what do you expect to happen > with the results of that SELECT in your code? > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM > To: Access List Cc: Paul Hartland > Subject: Re: [AccessD] Query runs and > doesn't run > > Have you tried running it without the where clause, then if it works > try again with one of the where clauses, then the other....also when I > used to query dates in access I would use something like the below, > formatting the date > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > On 9 Jan 2018 22:23, "Kaup, Chester" > wrote: > > > Well I did find one syntax error. Need two pairs of double quotes > > around PATT. Should have been ""PATT"". Still getting no results > > though. > > > > From: Kaup, Chester > > Sent: Tuesday, January 09, 2018 3:50 PM > > To: 'Access Developers discussion and problem solving' > > Subject: Query runs and doesn't run > > > > I have the following query that run just fine from the query grid > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND > > ((Allocations.Date)=#6/1/1935#)); > > > > I have the same query in VBA but it generates no output. I am at a > > loss as to what is going on. Here is the VBA part. > > > > Dim dbs As DAO.Database > > Set dbs = CurrentDb > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > Factors] " & _ > > "FROM Allocations " & _ > > "WHERE Allocations.PTYPE='PATT' AND > > Allocations.Date=#6/1/1935#;" > > > > dbs.Execute strSQL > > > > > > What is even stranger is the following statement does not fail > > although I do not see the table in the list of tables > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bensonforums at gmail.com Tue Jan 9 18:35:51 2018 From: bensonforums at gmail.com (Bill Benson) Date: Tue, 9 Jan 2018 19:35:51 -0500 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> Message-ID: Is it possible that the table already exists? Is it possible that the table is bound to any queries reports or forms that might be open? Have you tried deleting the table first and refreshing the tabledefs collection as a prerequisite? On Jan 9, 2018 7:20 PM, "Stuart McLachlan" wrote: > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > failing. That is an > action query. > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > UPDATE, DELETE). Won't work with a SELECT. > > > > If you think about it, that makes sense; what do you expect to happen > > with the results of that SELECT in your code? > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM > > To: Access List Cc: Paul Hartland > > Subject: Re: [AccessD] Query runs and > > doesn't run > > > > Have you tried running it without the where clause, then if it works > > try again with one of the where clauses, then the other....also when I > > used to query dates in access I would use something like the below, > > formatting the date > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > wrote: > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > around PATT. Should have been ""PATT"". Still getting no results > > > though. > > > > > > From: Kaup, Chester > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > To: 'Access Developers discussion and problem solving' > > > Subject: Query runs and doesn't run > > > > > > I have the following query that run just fine from the query grid > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > > Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > I have the same query in VBA but it generates no output. I am at a > > > loss as to what is going on. Here is the VBA part. > > > > > > Dim dbs As DAO.Database > > > Set dbs = CurrentDb > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > > Factors] " & _ > > > "FROM Allocations " & _ > > > "WHERE Allocations.PTYPE='PATT' AND > > > Allocations.Date=#6/1/1935#;" > > > > > > dbs.Execute strSQL > > > > > > > > > What is even stranger is the following statement does not fail > > > although I do not see the table in the list of tables > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rockysmolin at bchacc.com Tue Jan 9 18:54:03 2018 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 9 Jan 2018 16:54:03 -0800 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> Message-ID: <018401d389ad$829cfbb0$87d6f310$@bchacc.com> If you delete everything in [tbl Initial Pattern Factors] then run the code, does anything appear in [tbl Initial Pattern Factors]? I assume that [tbl Initial Pattern Factors] has six fields that match the datatypes in Allocations, yes? Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, January 09, 2018 1:50 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Query runs and doesn't run I have the following query that run just fine from the query grid SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND ((Allocations.Date)=#6/1/1935#)); I have the same query in VBA but it generates no output. I am at a loss as to what is going on. Here is the VBA part. Dim dbs As DAO.Database Set dbs = CurrentDb strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, Allocations.PID, Allocations.PTYPE, Allocations.Date, Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern Factors] " & _ "FROM Allocations " & _ "WHERE Allocations.PTYPE='PATT' AND Allocations.Date=#6/1/1935#;" dbs.Execute strSQL What is even stranger is the following statement does not fail although I do not see the table in the list of tables DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DMcGillivray at ctc.ca.gov Tue Jan 9 18:59:31 2018 From: DMcGillivray at ctc.ca.gov (McGillivray, Don) Date: Wed, 10 Jan 2018 00:59:31 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com>, , <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> Message-ID: <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> So it is. I tested this and got a result similar to Chester's. However, when I loop through all the table defs in the DB, the new table is there. (That would explain why his deletion of the table doesn't fail.) So, it's not that the table isn't there, but just that it doesn't appear in the object pane. There's probably a way to make it appear using code, but I found that using F5 in the DB container will do it. Closing and reopening the DB seems to work as well. I seem to remember having to refresh the table def collection when creating a table from scratch in code in order to see the result in the object pane. I tried db.TableDefs.Refresh, but that didn't do it. Maybe somebody else knows the secret sauce. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Tuesday, January 09, 2018 4:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query runs and doesn't run It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is failing. That is an action query. On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > UPDATE, DELETE). Won't work with a SELECT. > > If you think about it, that makes sense; what do you expect to happen > with the results of that SELECT in your code? > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM > To: Access List Cc: Paul Hartland > Subject: Re: [AccessD] Query runs and > doesn't run > > Have you tried running it without the where clause, then if it works > try again with one of the where clauses, then the other....also when I > used to query dates in access I would use something like the below, > formatting the date > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > On 9 Jan 2018 22:23, "Kaup, Chester" > wrote: > > > Well I did find one syntax error. Need two pairs of double quotes > > around PATT. Should have been ""PATT"". Still getting no results > > though. > > > > From: Kaup, Chester > > Sent: Tuesday, January 09, 2018 3:50 PM > > To: 'Access Developers discussion and problem solving' > > Subject: Query runs and doesn't run > > > > I have the following query that run just fine from the query grid > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND > > ((Allocations.Date)=#6/1/1935#)); > > > > I have the same query in VBA but it generates no output. I am at a > > loss as to what is going on. Here is the VBA part. > > > > Dim dbs As DAO.Database > > Set dbs = CurrentDb > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > Factors] " & _ > > "FROM Allocations " & _ > > "WHERE Allocations.PTYPE='PATT' AND > > Allocations.Date=#6/1/1935#;" > > > > dbs.Execute strSQL > > > > > > What is even stranger is the following statement does not fail > > although I do not see the table in the list of tables > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Tue Jan 9 19:13:02 2018 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 10 Jan 2018 11:13:02 +1000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com>, <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg>, <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> Message-ID: <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> Yep, that's the most likely situation. The query is working, butt the table is not being displayed. RefreshDatabaseWindow may be the solution: https://msdn.microsoft.com/en-us/library/office/aa221557(v=office.11).aspx On 10 Jan 2018 at 0:59, McGillivray, Don wrote: > So it is. > > I tested this and got a result similar to Chester's. However, when I > loop through all the table defs in the DB, the new table is there. > (That would explain why his deletion of the table doesn't fail.) So, > it's not that the table isn't there, but just that it doesn't appear > in the object pane. > > There's probably a way to make it appear using code, but I found that > using F5 in the DB container will do it. Closing and reopening the DB > seems to work as well. > > I seem to remember having to refresh the table def collection when > creating a table from scratch in code in order to see the result in > the object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > Maybe somebody else knows the secret sauce. > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Stuart McLachlan Sent: Tuesday, January 09, 2018 4:19 PM To: Access > Developers discussion and problem solving > Subject: Re: [AccessD] Query runs and > doesn't run > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > failing. That is an action query. > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > UPDATE, DELETE). Won't work with a SELECT. > > > > If you think about it, that makes sense; what do you expect to > > happen with the results of that SELECT in your code? > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 > > 2:34 PM To: Access List Cc: Paul > > Hartland Subject: Re: [AccessD] Query > > runs and doesn't run > > > > Have you tried running it without the where clause, then if it works > > try again with one of the where clauses, then the other....also when > > I used to query dates in access I would use something like the > > below, formatting the date > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > wrote: > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > around PATT. Should have been ""PATT"". Still getting no results > > > though. > > > > > > From: Kaup, Chester > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > To: 'Access Developers discussion and problem solving' > > > Subject: Query runs and doesn't run > > > > > > I have the following query that run just fine from the query grid > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] FROM Allocations WHERE > > > (((Allocations.PTYPE)="PATT") AND > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > I have the same query in VBA but it generates no output. I am at a > > > loss as to what is going on. Here is the VBA part. > > > > > > Dim dbs As DAO.Database > > > Set dbs = CurrentDb > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] " & _ > > > "FROM Allocations " & _ > > > "WHERE Allocations.PTYPE='PATT' AND > > > Allocations.Date=#6/1/1935#;" > > > > > > dbs.Execute strSQL > > > > > > > > > What is even stranger is the following statement does not fail > > > although I do not see the table in the list of tables > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bensonforums at gmail.com Tue Jan 9 19:13:23 2018 From: bensonforums at gmail.com (Bill Benson) Date: Tue, 9 Jan 2018 20:13:23 -0500 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> Message-ID: There ate cba command to toggle (hide then show) the object pane. RunCommand(acCmdWindowHide) DoCmdSelectObject(acTable, ,True) On Jan 9, 2018 8:00 PM, "McGillivray, Don" wrote: > So it is. > > I tested this and got a result similar to Chester's. However, when I loop > through all the table defs in the DB, the new table is there. (That would > explain why his deletion of the table doesn't fail.) So, it's not that the > table isn't there, but just that it doesn't appear in the object pane. > > There's probably a way to make it appear using code, but I found that > using F5 in the DB container will do it. Closing and reopening the DB > seems to work as well. > > I seem to remember having to refresh the table def collection when > creating a table from scratch in code in order to see the result in the > object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > Maybe somebody else knows the secret sauce. > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Stuart McLachlan > Sent: Tuesday, January 09, 2018 4:19 PM > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Subject: Re: [AccessD] Query runs and doesn't run > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > failing. That is an > action query. > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > UPDATE, DELETE). Won't work with a SELECT. > > > > If you think about it, that makes sense; what do you expect to happen > > with the results of that SELECT in your code? > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM > > To: Access List Cc: Paul Hartland > > Subject: Re: [AccessD] Query runs and > > doesn't run > > > > Have you tried running it without the where clause, then if it works > > try again with one of the where clauses, then the other....also when I > > used to query dates in access I would use something like the below, > > formatting the date > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > wrote: > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > around PATT. Should have been ""PATT"". Still getting no results > > > though. > > > > > > From: Kaup, Chester > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > To: 'Access Developers discussion and problem solving' > > > Subject: Query runs and doesn't run > > > > > > I have the following query that run just fine from the query grid > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > > Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > I have the same query in VBA but it generates no output. I am at a > > > loss as to what is going on. Here is the VBA part. > > > > > > Dim dbs As DAO.Database > > > Set dbs = CurrentDb > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > > Factors] " & _ > > > "FROM Allocations " & _ > > > "WHERE Allocations.PTYPE='PATT' AND > > > Allocations.Date=#6/1/1935#;" > > > > > > dbs.Execute strSQL > > > > > > > > > What is even stranger is the following statement does not fail > > > although I do not see the table in the list of tables > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bensonforums at gmail.com Tue Jan 9 19:13:51 2018 From: bensonforums at gmail.com (Bill Benson) Date: Tue, 9 Jan 2018 20:13:51 -0500 Subject: [AccessD] Query runs and doesn't run In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> Message-ID: Vba, not cba. On Jan 9, 2018 8:13 PM, "Bill Benson" wrote: > There ate cba command to toggle (hide then show) the object pane. > RunCommand(acCmdWindowHide) > DoCmdSelectObject(acTable, ,True) > > On Jan 9, 2018 8:00 PM, "McGillivray, Don" > wrote: > >> So it is. >> >> I tested this and got a result similar to Chester's. However, when I >> loop through all the table defs in the DB, the new table is there. (That >> would explain why his deletion of the table doesn't fail.) So, it's not >> that the table isn't there, but just that it doesn't appear in the object >> pane. >> >> There's probably a way to make it appear using code, but I found that >> using F5 in the DB container will do it. Closing and reopening the DB >> seems to work as well. >> >> I seem to remember having to refresh the table def collection when >> creating a table from scratch in code in order to see the result in the >> object pane. I tried db.TableDefs.Refresh, but that didn't do it. >> >> Maybe somebody else knows the secret sauce. >> >> >> -----Original Message----- >> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of >> Stuart McLachlan >> Sent: Tuesday, January 09, 2018 4:19 PM >> To: Access Developers discussion and problem solving < >> accessd at databaseadvisors.com> >> Subject: Re: [AccessD] Query runs and doesn't run >> >> It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is >> failing. That is an >> action query. >> >> >> On 9 Jan 2018 at 23:17, McGillivray, Don wrote: >> >> > I'm pretty sure that "dbs.execute" requires an action query (INSERT, >> > UPDATE, DELETE). Won't work with a SELECT. >> > >> > If you think about it, that makes sense; what do you expect to happen >> > with the results of that SELECT in your code? >> > >> > -----Original Message----- >> > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf >> > Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM >> > To: Access List Cc: Paul Hartland >> > Subject: Re: [AccessD] Query runs and >> > doesn't run >> > >> > Have you tried running it without the where clause, then if it works >> > try again with one of the where clauses, then the other....also when I >> > used to query dates in access I would use something like the below, >> > formatting the date >> > >> > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" >> > >> > On 9 Jan 2018 22:23, "Kaup, Chester" >> > wrote: >> > >> > > Well I did find one syntax error. Need two pairs of double quotes >> > > around PATT. Should have been ""PATT"". Still getting no results >> > > though. >> > > >> > > From: Kaup, Chester >> > > Sent: Tuesday, January 09, 2018 3:50 PM >> > > To: 'Access Developers discussion and problem solving' >> > > Subject: Query runs and doesn't run >> > > >> > > I have the following query that run just fine from the query grid >> > > >> > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, >> > > Allocations.PID, Allocations.PTYPE, Allocations.Date, >> > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern >> > > Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND >> > > ((Allocations.Date)=#6/1/1935#)); >> > > >> > > I have the same query in VBA but it generates no output. I am at a >> > > loss as to what is going on. Here is the VBA part. >> > > >> > > Dim dbs As DAO.Database >> > > Set dbs = CurrentDb >> > > >> > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, >> > > Allocations.PID, Allocations.PTYPE, Allocations.Date, >> > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern >> > > Factors] " & _ >> > > "FROM Allocations " & _ >> > > "WHERE Allocations.PTYPE='PATT' AND >> > > Allocations.Date=#6/1/1935#;" >> > > >> > > dbs.Execute strSQL >> > > >> > > >> > > What is even stranger is the following statement does not fail >> > > although I do not see the table in the list of tables >> > > >> > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" >> > > -- >> > > AccessD mailing list >> > > AccessD at databaseadvisors.com >> > > http://databaseadvisors.com/mailman/listinfo/accessd >> > > Website: http://www.databaseadvisors.com >> > > >> > -- >> > AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> > Website: http://www.databaseadvisors.com >> > >> > -- >> > AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> > Website: http://www.databaseadvisors.com >> > >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From DMcGillivray at ctc.ca.gov Tue Jan 9 19:16:57 2018 From: DMcGillivray at ctc.ca.gov (McGillivray, Don) Date: Wed, 10 Jan 2018 01:16:57 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com>, <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg>, <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> Message-ID: <04118daaed4d4f618c549a1bbb68f47f@ctc.ca.gov> Just tried that, and it does work. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Tuesday, January 09, 2018 5:13 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query runs and doesn't run Yep, that's the most likely situation. The query is working, butt the table is not being displayed. RefreshDatabaseWindow may be the solution: https://msdn.microsoft.com/en-us/library/office/aa221557(v=office.11).aspx On 10 Jan 2018 at 0:59, McGillivray, Don wrote: > So it is. > > I tested this and got a result similar to Chester's. However, when I > loop through all the table defs in the DB, the new table is there. > (That would explain why his deletion of the table doesn't fail.) So, > it's not that the table isn't there, but just that it doesn't appear > in the object pane. > > There's probably a way to make it appear using code, but I found that > using F5 in the DB container will do it. Closing and reopening the DB > seems to work as well. > > I seem to remember having to refresh the table def collection when > creating a table from scratch in code in order to see the result in > the object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > Maybe somebody else knows the secret sauce. > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Stuart McLachlan Sent: Tuesday, January 09, 2018 4:19 PM To: Access > Developers discussion and problem solving > Subject: Re: [AccessD] Query runs and > doesn't run > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > failing. That is an action query. > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > UPDATE, DELETE). Won't work with a SELECT. > > > > If you think about it, that makes sense; what do you expect to > > happen with the results of that SELECT in your code? > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 > > 2:34 PM To: Access List Cc: Paul > > Hartland Subject: Re: [AccessD] Query > > runs and doesn't run > > > > Have you tried running it without the where clause, then if it works > > try again with one of the where clauses, then the other....also when > > I used to query dates in access I would use something like the > > below, formatting the date > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > wrote: > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > around PATT. Should have been ""PATT"". Still getting no results > > > though. > > > > > > From: Kaup, Chester > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > To: 'Access Developers discussion and problem solving' > > > Subject: Query runs and doesn't run > > > > > > I have the following query that run just fine from the query grid > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] FROM Allocations WHERE > > > (((Allocations.PTYPE)="PATT") AND > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > I have the same query in VBA but it generates no output. I am at a > > > loss as to what is going on. Here is the VBA part. > > > > > > Dim dbs As DAO.Database > > > Set dbs = CurrentDb > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] " & _ > > > "FROM Allocations " & _ > > > "WHERE Allocations.PTYPE='PATT' AND > > > Allocations.Date=#6/1/1935#;" > > > > > > dbs.Execute strSQL > > > > > > > > > What is even stranger is the following statement does not fail > > > although I do not see the table in the list of tables > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Tue Jan 9 20:21:53 2018 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 9 Jan 2018 19:21:53 -0700 (MST) Subject: [AccessD] Query runs and doesn't run In-Reply-To: <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> Message-ID: <1640509234.205067155.1515550913606.JavaMail.zimbra@shaw.ca> Check. Jim ----- Original Message ----- From: "stuart" To: "Access Developers discussion and problem solving" Sent: Tuesday, January 9, 2018 4:18:33 PM Subject: Re: [AccessD] Query runs and doesn't run It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is failing. That is an action query. On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > UPDATE, DELETE). Won't work with a SELECT. > > If you think about it, that makes sense; what do you expect to happen > with the results of that SELECT in your code? > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM > To: Access List Cc: Paul Hartland > Subject: Re: [AccessD] Query runs and > doesn't run > > Have you tried running it without the where clause, then if it works > try again with one of the where clauses, then the other....also when I > used to query dates in access I would use something like the below, > formatting the date > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > On 9 Jan 2018 22:23, "Kaup, Chester" > wrote: > > > Well I did find one syntax error. Need two pairs of double quotes > > around PATT. Should have been ""PATT"". Still getting no results > > though. > > > > From: Kaup, Chester > > Sent: Tuesday, January 09, 2018 3:50 PM > > To: 'Access Developers discussion and problem solving' > > Subject: Query runs and doesn't run > > > > I have the following query that run just fine from the query grid > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND > > ((Allocations.Date)=#6/1/1935#)); > > > > I have the same query in VBA but it generates no output. I am at a > > loss as to what is going on. Here is the VBA part. > > > > Dim dbs As DAO.Database > > Set dbs = CurrentDb > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern > > Factors] " & _ > > "FROM Allocations " & _ > > "WHERE Allocations.PTYPE='PATT' AND > > Allocations.Date=#6/1/1935#;" > > > > dbs.Execute strSQL > > > > > > What is even stranger is the following statement does not fail > > although I do not see the table in the list of tables > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Tue Jan 9 20:29:49 2018 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 9 Jan 2018 19:29:49 -0700 (MST) Subject: [AccessD] Query runs and doesn't run In-Reply-To: <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> Message-ID: <1365261615.205082516.1515551389763.JavaMail.zimbra@shaw.ca> Excellent code tool. Jim ----- Original Message ----- From: "stuart" To: "Access Developers discussion and problem solving" Sent: Tuesday, January 9, 2018 5:13:02 PM Subject: Re: [AccessD] Query runs and doesn't run Yep, that's the most likely situation. The query is working, butt the table is not being displayed. RefreshDatabaseWindow may be the solution: https://msdn.microsoft.com/en-us/library/office/aa221557(v=office.11).aspx On 10 Jan 2018 at 0:59, McGillivray, Don wrote: > So it is. > > I tested this and got a result similar to Chester's. However, when I > loop through all the table defs in the DB, the new table is there. > (That would explain why his deletion of the table doesn't fail.) So, > it's not that the table isn't there, but just that it doesn't appear > in the object pane. > > There's probably a way to make it appear using code, but I found that > using F5 in the DB container will do it. Closing and reopening the DB > seems to work as well. > > I seem to remember having to refresh the table def collection when > creating a table from scratch in code in order to see the result in > the object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > Maybe somebody else knows the secret sauce. > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Stuart McLachlan Sent: Tuesday, January 09, 2018 4:19 PM To: Access > Developers discussion and problem solving > Subject: Re: [AccessD] Query runs and > doesn't run > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > failing. That is an action query. > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > UPDATE, DELETE). Won't work with a SELECT. > > > > If you think about it, that makes sense; what do you expect to > > happen with the results of that SELECT in your code? > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 > > 2:34 PM To: Access List Cc: Paul > > Hartland Subject: Re: [AccessD] Query > > runs and doesn't run > > > > Have you tried running it without the where clause, then if it works > > try again with one of the where clauses, then the other....also when > > I used to query dates in access I would use something like the > > below, formatting the date > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > wrote: > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > around PATT. Should have been ""PATT"". Still getting no results > > > though. > > > > > > From: Kaup, Chester > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > To: 'Access Developers discussion and problem solving' > > > Subject: Query runs and doesn't run > > > > > > I have the following query that run just fine from the query grid > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] FROM Allocations WHERE > > > (((Allocations.PTYPE)="PATT") AND > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > I have the same query in VBA but it generates no output. I am at a > > > loss as to what is going on. Here is the VBA part. > > > > > > Dim dbs As DAO.Database > > > Set dbs = CurrentDb > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] " & _ > > > "FROM Allocations " & _ > > > "WHERE Allocations.PTYPE='PATT' AND > > > Allocations.Date=#6/1/1935#;" > > > > > > dbs.Execute strSQL > > > > > > > > > What is even stranger is the following statement does not fail > > > although I do not see the table in the list of tables > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Tue Jan 9 20:51:20 2018 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 9 Jan 2018 19:51:20 -0700 (MST) Subject: [AccessD] Query runs and doesn't run In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> Message-ID: <1439879061.205115660.1515552680432.JavaMail.zimbra@shaw.ca> It was luck we all had "auto-correct" on. ;-) Jim ----- Original Message ----- From: "Bill Benson" To: "Access Developers discussion and problem solving" Sent: Tuesday, January 9, 2018 5:13:51 PM Subject: Re: [AccessD] Query runs and doesn't run Vba, not cba. On Jan 9, 2018 8:13 PM, "Bill Benson" wrote: > There ate cba command to toggle (hide then show) the object pane. > RunCommand(acCmdWindowHide) > DoCmdSelectObject(acTable, ,True) > > On Jan 9, 2018 8:00 PM, "McGillivray, Don" > wrote: > >> So it is. >> >> I tested this and got a result similar to Chester's. However, when I >> loop through all the table defs in the DB, the new table is there. (That >> would explain why his deletion of the table doesn't fail.) So, it's not >> that the table isn't there, but just that it doesn't appear in the object >> pane. >> >> There's probably a way to make it appear using code, but I found that >> using F5 in the DB container will do it. Closing and reopening the DB >> seems to work as well. >> >> I seem to remember having to refresh the table def collection when >> creating a table from scratch in code in order to see the result in the >> object pane. I tried db.TableDefs.Refresh, but that didn't do it. >> >> Maybe somebody else knows the secret sauce. >> >> >> -----Original Message----- >> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of >> Stuart McLachlan >> Sent: Tuesday, January 09, 2018 4:19 PM >> To: Access Developers discussion and problem solving < >> accessd at databaseadvisors.com> >> Subject: Re: [AccessD] Query runs and doesn't run >> >> It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is >> failing. That is an >> action query. >> >> >> On 9 Jan 2018 at 23:17, McGillivray, Don wrote: >> >> > I'm pretty sure that "dbs.execute" requires an action query (INSERT, >> > UPDATE, DELETE). Won't work with a SELECT. >> > >> > If you think about it, that makes sense; what do you expect to happen >> > with the results of that SELECT in your code? >> > >> > -----Original Message----- >> > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf >> > Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 2:34 PM >> > To: Access List Cc: Paul Hartland >> > Subject: Re: [AccessD] Query runs and >> > doesn't run >> > >> > Have you tried running it without the where clause, then if it works >> > try again with one of the where clauses, then the other....also when I >> > used to query dates in access I would use something like the below, >> > formatting the date >> > >> > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" >> > >> > On 9 Jan 2018 22:23, "Kaup, Chester" >> > wrote: >> > >> > > Well I did find one syntax error. Need two pairs of double quotes >> > > around PATT. Should have been ""PATT"". Still getting no results >> > > though. >> > > >> > > From: Kaup, Chester >> > > Sent: Tuesday, January 09, 2018 3:50 PM >> > > To: 'Access Developers discussion and problem solving' >> > > Subject: Query runs and doesn't run >> > > >> > > I have the following query that run just fine from the query grid >> > > >> > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, >> > > Allocations.PID, Allocations.PTYPE, Allocations.Date, >> > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern >> > > Factors] FROM Allocations WHERE (((Allocations.PTYPE)="PATT") AND >> > > ((Allocations.Date)=#6/1/1935#)); >> > > >> > > I have the same query in VBA but it generates no output. I am at a >> > > loss as to what is going on. Here is the VBA part. >> > > >> > > Dim dbs As DAO.Database >> > > Set dbs = CurrentDb >> > > >> > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, >> > > Allocations.PID, Allocations.PTYPE, Allocations.Date, >> > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial Pattern >> > > Factors] " & _ >> > > "FROM Allocations " & _ >> > > "WHERE Allocations.PTYPE='PATT' AND >> > > Allocations.Date=#6/1/1935#;" >> > > >> > > dbs.Execute strSQL >> > > >> > > >> > > What is even stranger is the following statement does not fail >> > > although I do not see the table in the list of tables >> > > >> > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" >> > > -- >> > > AccessD mailing list >> > > AccessD at databaseadvisors.com >> > > http://databaseadvisors.com/mailman/listinfo/accessd >> > > Website: http://www.databaseadvisors.com >> > > >> > -- >> > AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> > Website: http://www.databaseadvisors.com >> > >> > -- >> > AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> > Website: http://www.databaseadvisors.com >> > >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Jan 9 22:20:19 2018 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 9 Jan 2018 20:20:19 -0800 Subject: [AccessD] Excel Automation Questions References: <059a01d38820$a725f510$f571df30$@bchacc.com> <000301d38830$1a40d2e0$4ec278a0$@dalyn.co.nz> Message-ID: <002201d389ca$53628140$fa2783c0$@bchacc.com> BTW... it worked!!! (Of course, you knew that) I had to put it into a loop so it would do each row differently but that's only a couple more lined of code. Mil gracias. r -----Original Message----- From: Rocky Smolin [mailto:rockysmolin at bchacc.com] Sent: Sunday, January 07, 2018 7:41 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Excel Automation Questions Thanks. I'll try it. Looks promising. What's the "7" for? What's in intRow? R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Sunday, January 07, 2018 7:24 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Excel Automation Questions Hi Rocky, Try: xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, 8 January 2018 2:33 p.m. To: 'Access Developers discussion and problem solving' Subject: [AccessD] Excel Automation Questions Dear List(s): I have a client who wants a custom Excel spreadsheet exported from his Access data. There is one field which can get quite long and in the report it's easy - the field width is set in the design view and the Can Grow is set to yes. So the row height changes with the height of that text box. Normally when I automate a custom spreadsheet from Access I issue the command on VBA which sets all the field widths to the longest data of any record for that field. In this case, however, there may be 300 characters or more in the exported field, so I need to set that field to a specific width, like 3 inches or so, and set the field to wrap text. However, the height of that specific row would need to be changed to accommodate/show all those characters. But I don't want to set ALL the rows to a height which will accommodate the largest number of rows of any record. So.is there a way in Excel to accomplish this - to automagically set the height of a row to accommodate the largest number of lines in a field in that row? If so, I can figure out how to do it in VBA by recording a macro. MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Wed Jan 10 08:55:16 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 10 Jan 2018 14:55:16 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <41b522f548d44630b91622888e9f48e4@ctc.ca.gov> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E6B7@HOUEX11.kindermorgan.com> Did some testing and a compact and repair made the table visible. Tried your suggestion (CmdSelectObject(acTable, ,True) and It worked when I specified the table name. Thanks everyone for your assistance. I am now thinking however of changing ny method of deleting and recreating table to deleting the table contents and then appending to the tables. Fear of database bloat. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Tuesday, January 09, 2018 7:13 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query runs and doesn't run [This email message was received from the Internet and came from outside of Kinder Morgan] There ate cba command to toggle (hide then show) the object pane. RunCommand(acCmdWindowHide) DoCmdSelectObject(acTable, ,True) On Jan 9, 2018 8:00 PM, "McGillivray, Don" wrote: > So it is. > > I tested this and got a result similar to Chester's. However, when I > loop through all the table defs in the DB, the new table is there. > (That would explain why his deletion of the table doesn't fail.) So, > it's not that the table isn't there, but just that it doesn't appear in the object pane. > > There's probably a way to make it appear using code, but I found that > using F5 in the DB container will do it. Closing and reopening the DB > seems to work as well. > > I seem to remember having to refresh the table def collection when > creating a table from scratch in code in order to see the result in > the object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > Maybe somebody else knows the secret sauce. > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Stuart McLachlan > Sent: Tuesday, January 09, 2018 4:19 PM > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Subject: Re: [AccessD] Query runs and doesn't run > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > failing. That is an > action query. > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > UPDATE, DELETE). Won't work with a SELECT. > > > > If you think about it, that makes sense; what do you expect to > > happen with the results of that SELECT in your code? > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 > > 2:34 PM > > To: Access List Cc: Paul Hartland > > Subject: Re: [AccessD] Query runs and > > doesn't run > > > > Have you tried running it without the where clause, then if it works > > try again with one of the where clauses, then the other....also when > > I used to query dates in access I would use something like the > > below, formatting the date > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > wrote: > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > around PATT. Should have been ""PATT"". Still getting no results > > > though. > > > > > > From: Kaup, Chester > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > To: 'Access Developers discussion and problem solving' > > > Subject: Query runs and doesn't run > > > > > > I have the following query that run just fine from the query grid > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] FROM Allocations WHERE > > > (((Allocations.PTYPE)="PATT") AND > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > I have the same query in VBA but it generates no output. I am at a > > > loss as to what is going on. Here is the VBA part. > > > > > > Dim dbs As DAO.Database > > > Set dbs = CurrentDb > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] " & _ > > > "FROM Allocations " & _ > > > "WHERE Allocations.PTYPE='PATT' AND > > > Allocations.Date=#6/1/1935#;" > > > > > > dbs.Execute strSQL > > > > > > > > > What is even stranger is the following statement does not fail > > > although I do not see the table in the list of tables > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Wed Jan 10 09:03:12 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 10 Jan 2018 15:03:12 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com>, <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg>, <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E716@HOUEX11.kindermorgan.com> Works great. Thanks for the ideas. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Tuesday, January 09, 2018 7:13 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query runs and doesn't run [This email message was received from the Internet and came from outside of Kinder Morgan] Yep, that's the most likely situation. The query is working, butt the table is not being displayed. RefreshDatabaseWindow may be the solution: https://msdn.microsoft.com/en-us/library/office/aa221557(v=office.11).aspx On 10 Jan 2018 at 0:59, McGillivray, Don wrote: > So it is. > > I tested this and got a result similar to Chester's. However, when I > loop through all the table defs in the DB, the new table is there. > (That would explain why his deletion of the table doesn't fail.) So, > it's not that the table isn't there, but just that it doesn't appear > in the object pane. > > There's probably a way to make it appear using code, but I found that > using F5 in the DB container will do it. Closing and reopening the DB > seems to work as well. > > I seem to remember having to refresh the table def collection when > creating a table from scratch in code in order to see the result in > the object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > Maybe somebody else knows the secret sauce. > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Stuart McLachlan Sent: Tuesday, January 09, 2018 4:19 PM To: Access > Developers discussion and problem solving > Subject: Re: [AccessD] Query runs and > doesn't run > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > failing. That is an action query. > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > UPDATE, DELETE). Won't work with a SELECT. > > > > If you think about it, that makes sense; what do you expect to > > happen with the results of that SELECT in your code? > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 > > 2:34 PM To: Access List Cc: Paul > > Hartland Subject: Re: [AccessD] Query > > runs and doesn't run > > > > Have you tried running it without the where clause, then if it works > > try again with one of the where clauses, then the other....also when > > I used to query dates in access I would use something like the > > below, formatting the date > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > wrote: > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > around PATT. Should have been ""PATT"". Still getting no results > > > though. > > > > > > From: Kaup, Chester > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > To: 'Access Developers discussion and problem solving' > > > Subject: Query runs and doesn't run > > > > > > I have the following query that run just fine from the query grid > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] FROM Allocations WHERE > > > (((Allocations.PTYPE)="PATT") AND > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > I have the same query in VBA but it generates no output. I am at a > > > loss as to what is going on. Here is the VBA part. > > > > > > Dim dbs As DAO.Database > > > Set dbs = CurrentDb > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > Pattern Factors] " & _ > > > "FROM Allocations " & _ > > > "WHERE Allocations.PTYPE='PATT' AND > > > Allocations.Date=#6/1/1935#;" > > > > > > dbs.Execute strSQL > > > > > > > > > What is even stranger is the following statement does not fail > > > although I do not see the table in the list of tables > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Wed Jan 10 14:15:53 2018 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 10 Jan 2018 15:15:53 -0500 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <1365261615.205082516.1515551389763.JavaMail.zimbra@shaw.ca> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> <1365261615.205082516.1515551389763.JavaMail.zimbra@shaw.ca> Message-ID: My code sample had a two-step toggle, because a database could be in a mode where the pane is not shown, and I have seen that closing and reopening the pane works wonders, manually, therefore anticipated like success when done with VBA. Granted, in this case the navigation pane is obviously already in view due to the fact that the OP was noticing, visually, the "seeming" absence of the table, which is why I offered code that would close then force open the navigation pane. At least, that is what I have been able to use that code for, in the past. Stuart or Jim, what is the "required" expression with which to anchor the *RefreshDatabaseWindow *method? The link says it is required, then the code sample doesn't even specify one! On Tue, Jan 9, 2018 at 9:29 PM, Jim Lawrence wrote: > Excellent code tool. > > Jim > > ----- Original Message ----- > From: "stuart" > To: "Access Developers discussion and problem solving" < > accessd at databaseadvisors.com> > Sent: Tuesday, January 9, 2018 5:13:02 PM > Subject: Re: [AccessD] Query runs and doesn't run > > Yep, that's the most likely situation. The query is working, butt the > table is not being > displayed. > > > RefreshDatabaseWindow may be the solution: > > https://msdn.microsoft.com/en-us/library/office/aa221557(v=office.11).aspx > > On 10 Jan 2018 at 0:59, McGillivray, Don wrote: > > > So it is. > > > > I tested this and got a result similar to Chester's. However, when I > > loop through all the table defs in the DB, the new table is there. > > (That would explain why his deletion of the table doesn't fail.) So, > > it's not that the table isn't there, but just that it doesn't appear > > in the object pane. > > > > There's probably a way to make it appear using code, but I found that > > using F5 in the DB container will do it. Closing and reopening the DB > > seems to work as well. > > > > I seem to remember having to refresh the table def collection when > > creating a table from scratch in code in order to see the result in > > the object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > > > Maybe somebody else knows the secret sauce. > > > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of Stuart McLachlan Sent: Tuesday, January 09, 2018 4:19 PM To: Access > > Developers discussion and problem solving > > Subject: Re: [AccessD] Query runs and > > doesn't run > > > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > > failing. That is an action query. > > > > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > > > I'm pretty sure that "dbs.execute" requires an action query (INSERT, > > > UPDATE, DELETE). Won't work with a SELECT. > > > > > > If you think about it, that makes sense; what do you expect to > > > happen with the results of that SELECT in your code? > > > > > > -----Original Message----- > > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > > Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, 2018 > > > 2:34 PM To: Access List Cc: Paul > > > Hartland Subject: Re: [AccessD] Query > > > runs and doesn't run > > > > > > Have you tried running it without the where clause, then if it works > > > try again with one of the where clauses, then the other....also when > > > I used to query dates in access I would use something like the > > > below, formatting the date > > > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > > wrote: > > > > > > > Well I did find one syntax error. Need two pairs of double quotes > > > > around PATT. Should have been ""PATT"". Still getting no results > > > > though. > > > > > > > > From: Kaup, Chester > > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > > To: 'Access Developers discussion and problem solving' > > > > Subject: Query runs and doesn't run > > > > > > > > I have the following query that run just fine from the query grid > > > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > > Pattern Factors] FROM Allocations WHERE > > > > (((Allocations.PTYPE)="PATT") AND > > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > > > I have the same query in VBA but it generates no output. I am at a > > > > loss as to what is going on. Here is the VBA part. > > > > > > > > Dim dbs As DAO.Database > > > > Set dbs = CurrentDb > > > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > > Pattern Factors] " & _ > > > > "FROM Allocations " & _ > > > > "WHERE Allocations.PTYPE='PATT' AND > > > > Allocations.Date=#6/1/1935#;" > > > > > > > > dbs.Execute strSQL > > > > > > > > > > > > What is even stranger is the following statement does not fail > > > > although I do not see the table in the list of tables > > > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Jan 10 14:23:03 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 10 Jan 2018 20:23:03 +0000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <5A555BD9.19927.8962F49C@stuart.lexacorp.com.pg> <2454df01e8434110939c2ecfd56e0683@ctc.ca.gov> <5A55689E.6269.8994D480@stuart.lexacorp.com.pg> <1365261615.205082516.1515551389763.JavaMail.zimbra@shaw.ca> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E975@HOUEX11.kindermorgan.com> I tried it as Application.RefreshDatabaseWindow and it worked fine. There may be other ways. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Wednesday, January 10, 2018 2:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query runs and doesn't run [This email message was received from the Internet and came from outside of Kinder Morgan] My code sample had a two-step toggle, because a database could be in a mode where the pane is not shown, and I have seen that closing and reopening the pane works wonders, manually, therefore anticipated like success when done with VBA. Granted, in this case the navigation pane is obviously already in view due to the fact that the OP was noticing, visually, the "seeming" absence of the table, which is why I offered code that would close then force open the navigation pane. At least, that is what I have been able to use that code for, in the past. Stuart or Jim, what is the "required" expression with which to anchor the *RefreshDatabaseWindow *method? The link says it is required, then the code sample doesn't even specify one! On Tue, Jan 9, 2018 at 9:29 PM, Jim Lawrence wrote: > Excellent code tool. > > Jim > > ----- Original Message ----- > From: "stuart" > To: "Access Developers discussion and problem solving" < > accessd at databaseadvisors.com> > Sent: Tuesday, January 9, 2018 5:13:02 PM > Subject: Re: [AccessD] Query runs and doesn't run > > Yep, that's the most likely situation. The query is working, butt the > table is not being displayed. > > > RefreshDatabaseWindow may be the solution: > > https://msdn.microsoft.com/en-us/library/office/aa221557(v=office.11). > aspx > > On 10 Jan 2018 at 0:59, McGillivray, Don wrote: > > > So it is. > > > > I tested this and got a result similar to Chester's. However, when > > I loop through all the table defs in the DB, the new table is there. > > (That would explain why his deletion of the table doesn't fail.) > > So, it's not that the table isn't there, but just that it doesn't > > appear in the object pane. > > > > There's probably a way to make it appear using code, but I found > > that using F5 in the DB container will do it. Closing and reopening > > the DB seems to work as well. > > > > I seem to remember having to refresh the table def collection when > > creating a table from scratch in code in order to see the result in > > the object pane. I tried db.TableDefs.Refresh, but that didn't do it. > > > > Maybe somebody else knows the secret sauce. > > > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of Stuart McLachlan Sent: Tuesday, January 09, 2018 4:19 PM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Query runs and > > doesn't run > > > > It's a "SELECT... INTO [tbl Initial Pattern Factors]... " that is > > failing. That is an action query. > > > > > > On 9 Jan 2018 at 23:17, McGillivray, Don wrote: > > > > > I'm pretty sure that "dbs.execute" requires an action query > > > (INSERT, UPDATE, DELETE). Won't work with a SELECT. > > > > > > If you think about it, that makes sense; what do you expect to > > > happen with the results of that SELECT in your code? > > > > > > -----Original Message----- > > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > > Behalf Of Paul Hartland via AccessD Sent: Tuesday, January 09, > > > 2018 > > > 2:34 PM To: Access List Cc: Paul > > > Hartland Subject: Re: [AccessD] > > > Query runs and doesn't run > > > > > > Have you tried running it without the where clause, then if it > > > works try again with one of the where clauses, then the > > > other....also when I used to query dates in access I would use > > > something like the below, formatting the date > > > > > > Where MyDate =#" & format("06/01/1935", "dd/mm/yyyy")& "#" > > > > > > On 9 Jan 2018 22:23, "Kaup, Chester" > > > > > > wrote: > > > > > > > Well I did find one syntax error. Need two pairs of double > > > > quotes around PATT. Should have been ""PATT"". Still getting no > > > > results though. > > > > > > > > From: Kaup, Chester > > > > Sent: Tuesday, January 09, 2018 3:50 PM > > > > To: 'Access Developers discussion and problem solving' > > > > Subject: Query runs and doesn't run > > > > > > > > I have the following query that run just fine from the query > > > > grid > > > > > > > > SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > > Pattern Factors] FROM Allocations WHERE > > > > (((Allocations.PTYPE)="PATT") AND > > > > ((Allocations.Date)=#6/1/1935#)); > > > > > > > > I have the same query in VBA but it generates no output. I am at > > > > a loss as to what is going on. Here is the VBA part. > > > > > > > > Dim dbs As DAO.Database > > > > Set dbs = CurrentDb > > > > > > > > strSQL = "SELECT Allocations.ChildPID, Allocations.ChildPTYPE, > > > > Allocations.PID, Allocations.PTYPE, Allocations.Date, > > > > Allocations.Factor_1, Allocations.Factor_2 INTO [tbl Initial > > > > Pattern Factors] " & _ > > > > "FROM Allocations " & _ > > > > "WHERE Allocations.PTYPE='PATT' AND > > > > Allocations.Date=#6/1/1935#;" > > > > > > > > dbs.Execute strSQL > > > > > > > > > > > > What is even stranger is the following statement does not fail > > > > although I do not see the table in the list of tables > > > > > > > > DoCmd.DeleteObject acTable, "tbl Initial Pattern Factors" > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Jan 10 16:49:19 2018 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 11 Jan 2018 08:49:19 +1000 Subject: [AccessD] Query runs and doesn't run In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com>, <1365261615.205082516.1515551389763.JavaMail.zimbra@shaw.ca>, Message-ID: <5A56986F.29765.8E379C2A@stuart.lexacorp.com.pg> You don't need to specify the expression. The default (implicit) parent is the current application - "Application". (Type Application. in an immediate window and check out the autocomplete). Every one of the listed subs/functions/properties is the same. So RefreshDatabaseWindow and Application.RefreshDatabaseWIndow are equivalent. The only time you would need to explicitly state is if you are using VBA to control another Access application using Automation. On 10 Jan 2018 at 15:15, Bill Benson wrote: > > Stuart or Jim, what is the "required" expression with which to anchor > the *RefreshDatabaseWindow *method? The link says it is required, then > the code sample doesn't even specify one! > > From bensonforums at gmail.com Wed Jan 10 19:23:22 2018 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 10 Jan 2018 20:23:22 -0500 Subject: [AccessD] Query runs and doesn't run In-Reply-To: <5A56986F.29765.8E379C2A@stuart.lexacorp.com.pg> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B1E492@HOUEX11.kindermorgan.com> <1365261615.205082516.1515551389763.JavaMail.zimbra@shaw.ca> <5A56986F.29765.8E379C2A@stuart.lexacorp.com.pg> Message-ID: Good point (and thanks for making it). On Wed, Jan 10, 2018 at 5:49 PM, Stuart McLachlan wrote: > You don't need to specify the expression. > > The default (implicit) parent is the current application - "Application". > (Type Application. in an > immediate window and check out the autocomplete). Every one of the listed > subs/functions/properties is the same. > > So RefreshDatabaseWindow and Application.RefreshDatabaseWIndow are > equivalent. > > The only time you would need to explicitly state is if you are using > VBA to control > another Access application using Automation. > > From Chester_Kaup at kindermorgan.com Wed Jan 17 08:24:55 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 17 Jan 2018 14:24:55 +0000 Subject: [AccessD] Report opening issue Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B206DD@HOUEX11.kindermorgan.com> I have a report that opens quickly when selected from the object bar. I also have a form with a button on it that opens another form that has a button on it to open the report. When I attempt to open the report this way I have to wait about a minute to open the report or the button does nothing. There are no event procedures on the form that opens the report. Has anyone else experienced this problem? From df.waters at outlook.com Wed Jan 17 08:53:08 2018 From: df.waters at outlook.com (Dan Waters) Date: Wed, 17 Jan 2018 14:53:08 +0000 Subject: [AccessD] Report opening issue In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B206DD@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B206DD@HOUEX11.kindermorgan.com> Message-ID: Hi Chester, Off the top of my head it seems that this report may have a formatting problem. Look for any items on the report which overlap or where the edge of two elements have the same X or Y location. Also look for any elements which are white, or which are not visible. Dan -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: January 17, 2018 08:25 To: Access Developers discussion and problem solving Subject: [AccessD] Report opening issue I have a report that opens quickly when selected from the object bar. I also have a form with a button on it that opens another form that has a button on it to open the report. When I attempt to open the report this way I have to wait about a minute to open the report or the button does nothing. There are no event procedures on the form that opens the report. Has anyone else experienced this problem? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Wed Jan 17 09:41:50 2018 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 17 Jan 2018 15:41:50 +0000 Subject: [AccessD] Report opening issue In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B206DD@HOUEX11.kindermorgan.com> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB43B2079B@HOUEX11.kindermorgan.com> Problem SOLVED! The problem was not the design of the form. I had the second form opening before a bunch of code triggered by the first form had time to run. Changed when the form opened and it works correctly now. Thanks for the ideas. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Wednesday, January 17, 2018 8:53 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Report opening issue [This email message was received from the Internet and came from outside of Kinder Morgan] Hi Chester, Off the top of my head it seems that this report may have a formatting problem. Look for any items on the report which overlap or where the edge of two elements have the same X or Y location. Also look for any elements which are white, or which are not visible. Dan -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: January 17, 2018 08:25 To: Access Developers discussion and problem solving Subject: [AccessD] Report opening issue I have a report that opens quickly when selected from the object bar. I also have a form with a button on it that opens another form that has a button on it to open the report. When I attempt to open the report this way I have to wait about a minute to open the report or the button does nothing. There are no event procedures on the form that opens the report. Has anyone else experienced this problem? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Mon Jan 22 20:51:31 2018 From: bensonforums at gmail.com (Bill Benson) Date: Mon, 22 Jan 2018 21:51:31 -0500 Subject: [AccessD] Linked tables have no rows and just field F1 Message-ID: I am trying to link to excel worksheets with this command DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, vListSheets(i), DATA_FILE, True vListSheets(i) is a particular worksheet. It has headers, and most of the sheets have data. DATA_FILE is the Excel file's path. What happens is each linked table has a field named F1 and the tables are empty. Probably a rookie mistake I am making... though I am not a rookie, so I am a little embarassed here. It has been 10 years or more since I used TransferSpreadsheet to link to an Excel file. From gustav at cactus.dk Tue Jan 23 02:20:11 2018 From: gustav at cactus.dk (Gustav Brock) Date: Tue, 23 Jan 2018 08:20:11 +0000 Subject: [AccessD] Linked tables have no rows and just field F1 Message-ID: Hi Bill That code will work, though vListSheets(i) not "is a particular worksheet" but will be the name given the linked table, and it will simply link the first worksheet. If empty, you'll see F1 only and, of course, no records. To link a particular worksheet, specify this as the last parameter: DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, TableName, FileName, True, "ParticularWorksheetName$" /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Bill Benson Sendt: 23. januar 2018 03:52 Til: Access Developers discussion and problem solving Emne: [AccessD] Linked tables have no rows and just field F1 I am trying to link to excel worksheets with this command DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, vListSheets(i), DATA_FILE, True vListSheets(i) is a particular worksheet. It has headers, and most of the sheets have data. DATA_FILE is the Excel file's path. What happens is each linked table has a field named F1 and the tables are empty. Probably a rookie mistake I am making... though I am not a rookie, so I am a little embarassed here. It has been 10 years or more since I used TransferSpreadsheet to link to an Excel file. From bensonforums at gmail.com Tue Jan 23 11:08:22 2018 From: bensonforums at gmail.com (Bill Benson) Date: Tue, 23 Jan 2018 12:08:22 -0500 Subject: [AccessD] Linked tables have no rows and just field F1 In-Reply-To: References: Message-ID: Gustav explained to me that I was linking the first sheet in the workbook rather than all sheets in my array of sheet names! Kudos for spotting that. On Mon, Jan 22, 2018 at 9:51 PM, Bill Benson wrote: > I am trying to link to excel worksheets with this command > > DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, > vListSheets(i), DATA_FILE, True > > > vListSheets(i) is a particular worksheet. It has headers, and most of the > sheets have data. > DATA_FILE is the Excel file's path. > > What happens is each linked table has a field named F1 and the tables are > empty. Probably a rookie mistake I am making... though I am not a rookie, > so I am a little embarassed here. It has been 10 years or more since I used > TransferSpreadsheet to link to an Excel file. > From dbdoug at gmail.com Tue Jan 23 12:12:33 2018 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 23 Jan 2018 10:12:33 -0800 Subject: [AccessD] Round function strangeness Message-ID: I used the Round function in a query that had 2 calculated fields. The first one was a calculation like a*b+1, the second a straight multiplication: a*b. The output from Round(a*b+1,1) was correctly rounded to one decimal place. The output from Round(a*b,1) wasn't rounded off at all. But when (in desperation), I changed this to Round(a*b+1-1,1), which is ridiculous, the output was rounded off correctly! Any comments? Doug From bensonforums at gmail.com Tue Jan 23 12:32:37 2018 From: bensonforums at gmail.com (Bill Benson) Date: Tue, 23 Jan 2018 13:32:37 -0500 Subject: [AccessD] Round function strangeness In-Reply-To: References: Message-ID: What is the data type of a and b? On Jan 23, 2018 1:15 PM, "Doug Steele" wrote: > I used the Round function in a query that had 2 calculated fields. The > first one was a calculation like a*b+1, the second a straight > multiplication: a*b. The output from Round(a*b+1,1) was correctly rounded > to one decimal place. The output from Round(a*b,1) wasn't rounded off at > all. But when (in desperation), I changed this to Round(a*b+1-1,1), which > is ridiculous, the output was rounded off correctly! > > Any comments? > > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jackandpat.d at gmail.com Tue Jan 23 12:45:05 2018 From: jackandpat.d at gmail.com (jack drawbridge) Date: Tue, 23 Jan 2018 13:45:05 -0500 Subject: [AccessD] Round function strangeness In-Reply-To: References: Message-ID: Gustav is the "rounding guru"! On Tue, Jan 23, 2018 at 1:32 PM, Bill Benson wrote: > What is the data type of a and b? > > On Jan 23, 2018 1:15 PM, "Doug Steele" wrote: > > > I used the Round function in a query that had 2 calculated fields. The > > first one was a calculation like a*b+1, the second a straight > > multiplication: a*b. The output from Round(a*b+1,1) was correctly rounded > > to one decimal place. The output from Round(a*b,1) wasn't rounded off at > > all. But when (in desperation), I changed this to Round(a*b+1-1,1), which > > is ridiculous, the output was rounded off correctly! > > > > Any comments? > > > > Doug > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Tue Jan 23 13:02:05 2018 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 23 Jan 2018 11:02:05 -0800 Subject: [AccessD] Round function strangeness In-Reply-To: References: Message-ID: singles. The calculations worked fine, it was the rounding that failed. On Tue, Jan 23, 2018 at 10:32 AM, Bill Benson wrote: > What is the data type of a and b? > > On Jan 23, 2018 1:15 PM, "Doug Steele" wrote: > > > I used the Round function in a query that had 2 calculated fields. The > > first one was a calculation like a*b+1, the second a straight > > multiplication: a*b. The output from Round(a*b+1,1) was correctly rounded > > to one decimal place. The output from Round(a*b,1) wasn't rounded off at > > all. But when (in desperation), I changed this to Round(a*b+1-1,1), which > > is ridiculous, the output was rounded off correctly! > > > > Any comments? > > > > Doug > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bensonforums at gmail.com Tue Jan 23 14:01:41 2018 From: bensonforums at gmail.com (Bill Benson) Date: Tue, 23 Jan 2018 15:01:41 -0500 Subject: [AccessD] Round function strangeness In-Reply-To: References: Message-ID: I have to admit, I am intrigued. I am waiting for someone to independently verify this is ubiquitous. I myself am not near a computer. I'd be interested too, to learn if this happens with other operations as well, where only fields are operated on and not constants, like Round (a+b,1) and Round (a/b,1). Do me one favor and see what happens if you include additional parens, such as Round((a*b),1). I'll be testing this myself in a couple of hours. On Jan 23, 2018 2:06 PM, "Doug Steele" wrote: > singles. The calculations worked fine, it was the rounding that failed. > > On Tue, Jan 23, 2018 at 10:32 AM, Bill Benson > wrote: > > > What is the data type of a and b? > > > > On Jan 23, 2018 1:15 PM, "Doug Steele" wrote: > > > > > I used the Round function in a query that had 2 calculated fields. The > > > first one was a calculation like a*b+1, the second a straight > > > multiplication: a*b. The output from Round(a*b+1,1) was correctly > rounded > > > to one decimal place. The output from Round(a*b,1) wasn't rounded off > at > > > all. But when (in desperation), I changed this to Round(a*b+1-1,1), > which > > > is ridiculous, the output was rounded off correctly! > > > > > > Any comments? > > > > > > Doug > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Tue Jan 23 14:11:18 2018 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 23 Jan 2018 12:11:18 -0800 Subject: [AccessD] Round function strangeness In-Reply-To: References: Message-ID: A good thought, but I did try adding extra parentheses. On Tue, Jan 23, 2018 at 12:01 PM, Bill Benson wrote: > I have to admit, I am intrigued. I am waiting for someone to independently > verify this is ubiquitous. I myself am not near a computer. > > I'd be interested too, to learn if this happens with other operations as > well, where only fields are operated on and not constants, like Round > (a+b,1) and Round (a/b,1). > > Do me one favor and see what happens if you include additional parens, such > as > Round((a*b),1). I'll be testing this myself in a couple of hours. > > On Jan 23, 2018 2:06 PM, "Doug Steele" wrote: > > > singles. The calculations worked fine, it was the rounding that failed. > > > > On Tue, Jan 23, 2018 at 10:32 AM, Bill Benson > > wrote: > > > > > What is the data type of a and b? > > > > > > On Jan 23, 2018 1:15 PM, "Doug Steele" wrote: > > > > > > > I used the Round function in a query that had 2 calculated fields. > The > > > > first one was a calculation like a*b+1, the second a straight > > > > multiplication: a*b. The output from Round(a*b+1,1) was correctly > > rounded > > > > to one decimal place. The output from Round(a*b,1) wasn't rounded off > > at > > > > all. But when (in desperation), I changed this to Round(a*b+1-1,1), > > which > > > > is ridiculous, the output was rounded off correctly! > > > > > > > > Any comments? > > > > > > > > Doug > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Wed Jan 24 00:55:38 2018 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 24 Jan 2018 06:55:38 +0000 Subject: [AccessD] Round function strangeness Message-ID: Hi Doug A random sample works as expected here: a = CSng(15.17345) b = CSng(23.23498) ? a, b, Round(a * b + 1, 1), Round(a * b, 1) 15.17345 23.23498 353.6 352.6 But Round is known to be buggy, though I haven't met the scenario you scenario you describe. Could you provide some of your value sets, please? And - thanks Jack - for any serious use of rounding, I strongly recommend using my rounding functions that will never fail: https://www.experts-exchange.com/articles/20299/Rounding-values-up-down-by-4-5-or-to-significant-figures.html or: https://www.codeproject.com/Tips/1022704/Rounding-Values-Up-Down-By-Or-To-Significant-Figur /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Doug Steele Sendt: 23. januar 2018 19:13 Til: Access Developers discussion and problem solving Emne: [AccessD] Round function strangeness I used the Round function in a query that had 2 calculated fields. The first one was a calculation like a*b+1, the second a straight multiplication: a*b. The output from Round(a*b+1,1) was correctly rounded to one decimal place. The output from Round(a*b,1) wasn't rounded off at all. But when (in desperation), I changed this to Round(a*b+1-1,1), which is ridiculous, the output was rounded off correctly! Any comments? Doug From wrwehler at gmail.com Wed Jan 24 09:54:07 2018 From: wrwehler at gmail.com (Ryan W) Date: Wed, 24 Jan 2018 09:54:07 -0600 Subject: [AccessD] Brain Fart on Report grouping Message-ID: I have a report that's grouped by Client name, each grouping has a footer that draws a line (thickness 1) to help break the report up between clients. At the end of the report, I have a REPORT footer that draws a line (thickness 2) with some statistics under it. Right now, when the last group footer prints a line, and the report footer prints it's line they're stacked on top of each other. I could have sworn there was some magic wizardry I've done in the past to not draw that last grouped footer line relatively easily. I have a solution that works NOW but it feels like kludge. Basically I have a global report variable defined at the top "strClient" In Report_Open event I set that variable using: strClient = DMax("ClientName", "Table") For GroupFooter1_Print event I have : Me.LineName.visible = not (Me.ClientName = strClientName) It works but as I said feels Kludgy. Thoughts? From jimdettman at verizon.net Wed Jan 24 11:28:33 2018 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 24 Jan 2018 12:28:33 -0500 Subject: [AccessD] Brain Fart on Report grouping In-Reply-To: References: Message-ID: <006e01d39538$c2d40b60$487c2220$@verizon.net> Well you need some type of flag to tell you when you are on the last client. There are several ways to do that, and believe it or not, what your doing is probably the cleanest. Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Ryan W Sent: Wednesday, January 24, 2018 10:54 AM To: Access Developers discussion and problem solving Subject: [AccessD] Brain Fart on Report grouping I have a report that's grouped by Client name, each grouping has a footer that draws a line (thickness 1) to help break the report up between clients. At the end of the report, I have a REPORT footer that draws a line (thickness 2) with some statistics under it. Right now, when the last group footer prints a line, and the report footer prints it's line they're stacked on top of each other. I could have sworn there was some magic wizardry I've done in the past to not draw that last grouped footer line relatively easily. I have a solution that works NOW but it feels like kludge. Basically I have a global report variable defined at the top "strClient" In Report_Open event I set that variable using: strClient = DMax("ClientName", "Table") For GroupFooter1_Print event I have : Me.LineName.visible = not (Me.ClientName = strClientName) It works but as I said feels Kludgy. Thoughts? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Wed Jan 24 11:35:34 2018 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 24 Jan 2018 12:35:34 -0500 Subject: [AccessD] Round function strangeness In-Reply-To: References: Message-ID: Doug had an issue in a query not in VBA. On Jan 24, 2018 1:58 AM, "Gustav Brock" wrote: Hi Doug A random sample works as expected here: a = CSng(15.17345) b = CSng(23.23498) ? a, b, Round(a * b + 1, 1), Round(a * b, 1) 15.17345 23.23498 353.6 352.6 But Round is known to be buggy, though I haven't met the scenario you scenario you describe. Could you provide some of your value sets, please? And - thanks Jack - for any serious use of rounding, I strongly recommend using my rounding functions that will never fail: https://www.experts-exchange.com/articles/20299/Rounding- values-up-down-by-4-5-or-to-significant-figures.html or: https://www.codeproject.com/Tips/1022704/Rounding-Values- Up-Down-By-Or-To-Significant-Figur /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Doug Steele Sendt: 23. januar 2018 19:13 Til: Access Developers discussion and problem solving < accessd at databaseadvisors.com> Emne: [AccessD] Round function strangeness I used the Round function in a query that had 2 calculated fields. The first one was a calculation like a*b+1, the second a straight multiplication: a*b. The output from Round(a*b+1,1) was correctly rounded to one decimal place. The output from Round(a*b,1) wasn't rounded off at all. But when (in desperation), I changed this to Round(a*b+1-1,1), which is ridiculous, the output was rounded off correctly! Any comments? Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at outlook.com Wed Jan 24 11:45:28 2018 From: df.waters at outlook.com (Dan Waters) Date: Wed, 24 Jan 2018 17:45:28 +0000 Subject: [AccessD] Brain Fart on Report grouping In-Reply-To: References: Message-ID: Hi Ryan, I don?t know of a non-code way to solve this but your code solution looks elegant to me! Nice work, Dan Sent from Mail for Windows 10 From: Ryan W Sent: Wednesday, January 24, 2018 09:58 To: Access Developers discussion and problem solving Subject: [AccessD] Brain Fart on Report grouping I have a report that's grouped by Client name, each grouping has a footer that draws a line (thickness 1) to help break the report up between clients. At the end of the report, I have a REPORT footer that draws a line (thickness 2) with some statistics under it. Right now, when the last group footer prints a line, and the report footer prints it's line they're stacked on top of each other. I could have sworn there was some magic wizardry I've done in the past to not draw that last grouped footer line relatively easily. I have a solution that works NOW but it feels like kludge. Basically I have a global report variable defined at the top "strClient" In Report_Open event I set that variable using: strClient = DMax("ClientName", "Table") For GroupFooter1_Print event I have : Me.LineName.visible = not (Me.ClientName = strClientName) It works but as I said feels Kludgy. Thoughts? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From wrwehler at gmail.com Wed Jan 24 11:46:36 2018 From: wrwehler at gmail.com (Ryan W) Date: Wed, 24 Jan 2018 11:46:36 -0600 Subject: [AccessD] Brain Fart on Report grouping In-Reply-To: <006e01d39538$c2d40b60$487c2220$@verizon.net> References: <006e01d39538$c2d40b60$487c2220$@verizon.net> Message-ID: Huh. Alright. I could have sworn there were some VBA properties in the OnPrint event to help tell where you were but it's been a while since I've had to write any VBA for report formatting on the fly. On Wed, Jan 24, 2018 at 11:28 AM, Jim Dettman wrote: > Well you need some type of flag to tell you when you are on the last > client. > > There are several ways to do that, and believe it or not, what your doing > is > probably the cleanest. > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Ryan W > Sent: Wednesday, January 24, 2018 10:54 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Brain Fart on Report grouping > > I have a report that's grouped by Client name, each grouping has a footer > that draws a line (thickness 1) to help break the report up between > clients. > > At the end of the report, I have a REPORT footer that draws a line > (thickness 2) with some statistics under it. > > > Right now, when the last group footer prints a line, and the report footer > prints it's line they're stacked on top of each other. I could have sworn > there was some magic wizardry I've done in the past to not draw that last > grouped footer line relatively easily. I have a solution that works NOW > but > it feels like kludge. > > > Basically I have a global report variable defined at the top "strClient" > > > In Report_Open event I set that variable using: > > strClient = DMax("ClientName", "Table") > > For GroupFooter1_Print event I have : > > Me.LineName.visible = not (Me.ClientName = strClientName) > > It works but as I said feels Kludgy. > > Thoughts? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Wed Jan 24 11:51:38 2018 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 24 Jan 2018 17:51:38 +0000 Subject: [AccessD] Round function strangeness Message-ID: Hi Bill and Doug Oh, missed that. However, I checked with the same values in a query using fields of Single. Same results as in VBA. /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Bill Benson Sendt: 24. januar 2018 18:36 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Round function strangeness Doug had an issue in a query not in VBA. On Jan 24, 2018 1:58 AM, "Gustav Brock" wrote: Hi Doug A random sample works as expected here: a = CSng(15.17345) b = CSng(23.23498) ? a, b, Round(a * b + 1, 1), Round(a * b, 1) 15.17345 23.23498 353.6 352.6 But Round is known to be buggy, though I haven't met the scenario you scenario you describe. Could you provide some of your value sets, please? And - thanks Jack - for any serious use of rounding, I strongly recommend using my rounding functions that will never fail: https://www.experts-exchange.com/articles/20299/Rounding-values-up-down-by-4-5-or-to-significant-figures.html or: https://www.codeproject.com/Tips/1022704/Rounding-Values-Up-Down-By-Or-To-Significant-Figur /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Doug Steele Sendt: 23. januar 2018 19:13 Til: Access Developers discussion and problem solving < accessd at databaseadvisors.com> Emne: [AccessD] Round function strangeness I used the Round function in a query that had 2 calculated fields. The first one was a calculation like a*b+1, the second a straight multiplication: a*b. The output from Round(a*b+1,1) was correctly rounded to one decimal place. The output from Round(a*b,1) wasn't rounded off at all. But when (in desperation), I changed this to Round(a*b+1-1,1), which is ridiculous, the output was rounded off correctly! Any comments? Doug From kost36 at otenet.gr Wed Jan 24 12:55:51 2018 From: kost36 at otenet.gr (kost36 at otenet.gr) Date: Wed, 24 Jan 2018 20:55:51 +0200 Subject: [AccessD] Concatenate seaparated by " ," and group by Message-ID: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> Dear all, Does anybody have ever used any kind of any concatenate function supporting "group by" in the same record too? Something familiar with what I need is Duane Hookom's, 2003 Concatenate function specially his example on the query Example of First Names and Roles in Family SELECT tblFamily.FamID, tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM tblFamily;) which returns FamID | famLastName | FirstNames 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there are more than one Son or more animals? What I really need is very close to it but a little different So, I have to concatenate all the crew of a movie grouped by people specialty e.g. Title | crew Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, name5.... Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) name10, name11 I would appreciate it very much if you could help on that. Thank's a lot /kostas From wrwehler at gmail.com Wed Jan 24 12:59:30 2018 From: wrwehler at gmail.com (Ryan W) Date: Wed, 24 Jan 2018 12:59:30 -0600 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> Message-ID: Maybe look into Allen Browne's ConcatRelated? http://allenbrowne.com/func-concat.html On Wed, Jan 24, 2018 at 12:55 PM, wrote: > Dear all, > Does anybody have ever used any kind of any concatenate function supporting > "group by" in the same record too? > Something familiar with what I need is Duane Hookom's, 2003 Concatenate > function specially his example on the query Example of First Names and > Roles > in Family > SELECT tblFamily.FamID, tblFamily.famLastName, Concatenate("SELECT > FirstName > & ' (' & Role & ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames > FROM tblFamily;) > > which returns > > FamID | famLastName | FirstNames > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > Chelsey (Daughter), Dakota (Dog), Josie (Cat) > But what about if there are more than one Son or more animals? > > What I really need is very close to it but a little different > So, I have to concatenate all the crew of a movie grouped by people > specialty e.g. > > Title | crew > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > name5.... > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) name10, > name11 > > I would appreciate it very much if you could help on that. > Thank's a lot > > /kostas > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From kost36 at otenet.gr Wed Jan 24 13:09:13 2018 From: kost36 at otenet.gr (kost36 at otenet.gr) Date: Wed, 24 Jan 2018 21:09:13 +0200 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> Message-ID: <043f01d39546$d2b59040$7820b0c0$@otenet.gr> Tried it too but with no luck ? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Ryan W Sent: Wednesday, January 24, 2018 9:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Concatenate seaparated by " ," and group by Maybe look into Allen Browne's ConcatRelated? http://allenbrowne.com/func-concat.html On Wed, Jan 24, 2018 at 12:55 PM, wrote: > Dear all, > Does anybody have ever used any kind of any concatenate function > supporting "group by" in the same record too? > Something familiar with what I need is Duane Hookom's, 2003 > Concatenate function specially his example on the query Example of > First Names and Roles in Family SELECT tblFamily.FamID, > tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & > ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM > tblFamily;) > > which returns > > FamID | famLastName | FirstNames > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there > are more than one Son or more animals? > > What I really need is very close to it but a little different So, I > have to concatenate all the crew of a movie grouped by people > specialty e.g. > > Title | crew > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > name5.... > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) > name10, > name11 > > I would appreciate it very much if you could help on that. > Thank's a lot > > /kostas > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Jan 24 13:33:53 2018 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 24 Jan 2018 14:33:53 -0500 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> Message-ID: <00b501d3954a$44948920$cdbd9b60$@verizon.net> Think that would depend more on the table/query design. Another Concat function: https://www.experts-exchange.com/articles/2380/Domain-Aggregate-for-Concaten ating-Values-by-Group-in-Microsoft-Access.html Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of kost36 at otenet.gr Sent: Wednesday, January 24, 2018 1:56 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Concatenate seaparated by " ," and group by Dear all, Does anybody have ever used any kind of any concatenate function supporting "group by" in the same record too? Something familiar with what I need is Duane Hookom's, 2003 Concatenate function specially his example on the query Example of First Names and Roles in Family SELECT tblFamily.FamID, tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM tblFamily;) which returns FamID | famLastName | FirstNames 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there are more than one Son or more animals? What I really need is very close to it but a little different So, I have to concatenate all the crew of a movie grouped by people specialty e.g. Title | crew Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, name5.... Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) name10, name11 I would appreciate it very much if you could help on that. Thank's a lot /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Jan 24 13:37:45 2018 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 24 Jan 2018 14:37:45 -0500 Subject: [AccessD] Brain Fart on Report grouping In-Reply-To: References: <006e01d39538$c2d40b60$487c2220$@verizon.net> Message-ID: <00b601d3954a$cf7b01e0$6e7105a0$@verizon.net> Maybe you're thinking of just knowing when you're on the last page, which is when you can do: If Me.Page = Me.Pages then But for last group, you need to know what the last group is. You can do what you did, walk through the recordset that the report is based on, or enable two pass printing and capture the last group on the first pass. For what you needed, what you did is the most efficient. Might possibly break in the future more easily if something is changed, but it is the most efficient method that I can think of. Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Ryan W Sent: Wednesday, January 24, 2018 12:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Brain Fart on Report grouping Huh. Alright. I could have sworn there were some VBA properties in the OnPrint event to help tell where you were but it's been a while since I've had to write any VBA for report formatting on the fly. On Wed, Jan 24, 2018 at 11:28 AM, Jim Dettman wrote: > Well you need some type of flag to tell you when you are on the last > client. > > There are several ways to do that, and believe it or not, what your > doing is probably the cleanest. > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Ryan W > Sent: Wednesday, January 24, 2018 10:54 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Brain Fart on Report grouping > > I have a report that's grouped by Client name, each grouping has a > footer that draws a line (thickness 1) to help break the report up > between clients. > > At the end of the report, I have a REPORT footer that draws a line > (thickness 2) with some statistics under it. > > > Right now, when the last group footer prints a line, and the report > footer prints it's line they're stacked on top of each other. I could > have sworn there was some magic wizardry I've done in the past to not > draw that last grouped footer line relatively easily. I have a > solution that works NOW but it feels like kludge. > > > Basically I have a global report variable defined at the top "strClient" > > > In Report_Open event I set that variable using: > > strClient = DMax("ClientName", "Table") > > For GroupFooter1_Print event I have : > > Me.LineName.visible = not (Me.ClientName = strClientName) > > It works but as I said feels Kludgy. > > Thoughts? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From wrwehler at gmail.com Wed Jan 24 13:45:25 2018 From: wrwehler at gmail.com (Ryan W) Date: Wed, 24 Jan 2018 13:45:25 -0600 Subject: [AccessD] Brain Fart on Report grouping In-Reply-To: <00b601d3954a$cf7b01e0$6e7105a0$@verizon.net> References: <006e01d39538$c2d40b60$487c2220$@verizon.net> <00b601d3954a$cf7b01e0$6e7105a0$@verizon.net> Message-ID: Yeah maybe it was Me.pages. Ah well this will work for now. I was feeling rusty for a moment. On Wed, Jan 24, 2018 at 1:37 PM, Jim Dettman wrote: > Maybe you're thinking of just knowing when you're on the last page, which > is > when you can do: > > If Me.Page = Me.Pages then > > But for last group, you need to know what the last group is. > > You can do what you did, walk through the recordset that the report is > based > on, or enable two pass printing and capture the last group on the first > pass. > > For what you needed, what you did is the most efficient. Might possibly > break in the future more easily if something is changed, but it is the most > efficient method that I can think of. > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Ryan W > Sent: Wednesday, January 24, 2018 12:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Brain Fart on Report grouping > > Huh. Alright. I could have sworn there were some VBA properties in the > OnPrint event to help tell where you were but it's been a while since I've > had to write any VBA for report formatting on the fly. > > > > > > On Wed, Jan 24, 2018 at 11:28 AM, Jim Dettman > wrote: > > > Well you need some type of flag to tell you when you are on the last > > client. > > > > There are several ways to do that, and believe it or not, what your > > doing is probably the cleanest. > > > > Jim. > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of Ryan W > > Sent: Wednesday, January 24, 2018 10:54 AM > > To: Access Developers discussion and problem solving > > Subject: [AccessD] Brain Fart on Report grouping > > > > I have a report that's grouped by Client name, each grouping has a > > footer that draws a line (thickness 1) to help break the report up > > between clients. > > > > At the end of the report, I have a REPORT footer that draws a line > > (thickness 2) with some statistics under it. > > > > > > Right now, when the last group footer prints a line, and the report > > footer prints it's line they're stacked on top of each other. I could > > have sworn there was some magic wizardry I've done in the past to not > > draw that last grouped footer line relatively easily. I have a > > solution that works NOW but it feels like kludge. > > > > > > Basically I have a global report variable defined at the top "strClient" > > > > > > In Report_Open event I set that variable using: > > > > strClient = DMax("ClientName", "Table") > > > > For GroupFooter1_Print event I have : > > > > Me.LineName.visible = not (Me.ClientName = strClientName) > > > > It works but as I said feels Kludgy. > > > > Thoughts? > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From wrwehler at gmail.com Wed Jan 24 14:06:00 2018 From: wrwehler at gmail.com (Ryan W) Date: Wed, 24 Jan 2018 14:06:00 -0600 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: <00b501d3954a$44948920$cdbd9b60$@verizon.net> References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> Message-ID: Isn't this what you're looking for? https://i.imgur.com/ymHsnRo.png Here's my code using ConcatRelated SELECT Table1.LastName, ConcatRelated("[FirstName] & '(' & [Role] & ')'","Table1","LastName = '" & [LastName] & "'") AS Expr1 FROM Table1; On Wed, Jan 24, 2018 at 1:33 PM, Jim Dettman wrote: > > Think that would depend more on the table/query design. > > Another Concat function: > > https://www.experts-exchange.com/articles/2380/Domain- > Aggregate-for-Concaten > ating-Values-by-Group-in-Microsoft-Access.html > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > kost36 at otenet.gr > Sent: Wednesday, January 24, 2018 1:56 PM > To: 'Access Developers discussion and problem solving' > Subject: [AccessD] Concatenate seaparated by " ," and group by > > Dear all, > Does anybody have ever used any kind of any concatenate function supporting > "group by" in the same record too? > Something familiar with what I need is Duane Hookom's, 2003 Concatenate > function specially his example on the query Example of First Names and > Roles > in Family SELECT tblFamily.FamID, tblFamily.famLastName, > Concatenate("SELECT > FirstName & ' (' & Role & ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS > FirstNames FROM tblFamily;) > > which returns > > FamID | famLastName | FirstNames > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there are > more than one Son or more animals? > > What I really need is very close to it but a little different So, I have to > concatenate all the crew of a movie grouped by people specialty e.g. > > Title | crew > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > name5.... > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) name10, > name11 > > I would appreciate it very much if you could help on that. > Thank's a lot > > /kostas > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From wrwehler at gmail.com Wed Jan 24 14:10:52 2018 From: wrwehler at gmail.com (Ryan W) Date: Wed, 24 Jan 2018 14:10:52 -0600 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> Message-ID: I should have added "SELECT DISTINCT" but I was just going for what you needed in a concatenation, I think. On Wed, Jan 24, 2018 at 2:06 PM, Ryan W wrote: > Isn't this what you're looking for? > > https://i.imgur.com/ymHsnRo.png > > Here's my code using ConcatRelated > > > SELECT Table1.LastName, ConcatRelated("[FirstName] & '(' & [Role] & > ')'","Table1","LastName = '" & [LastName] & "'") AS Expr1 > FROM Table1; > > > > > On Wed, Jan 24, 2018 at 1:33 PM, Jim Dettman > wrote: > >> >> Think that would depend more on the table/query design. >> >> Another Concat function: >> >> https://www.experts-exchange.com/articles/2380/Domain-Aggreg >> ate-for-Concaten >> ating-Values-by-Group-in-Microsoft-Access.html >> >> >> Jim. >> >> -----Original Message----- >> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of >> kost36 at otenet.gr >> Sent: Wednesday, January 24, 2018 1:56 PM >> To: 'Access Developers discussion and problem solving' >> Subject: [AccessD] Concatenate seaparated by " ," and group by >> >> Dear all, >> Does anybody have ever used any kind of any concatenate function >> supporting >> "group by" in the same record too? >> Something familiar with what I need is Duane Hookom's, 2003 Concatenate >> function specially his example on the query Example of First Names and >> Roles >> in Family SELECT tblFamily.FamID, tblFamily.famLastName, >> Concatenate("SELECT >> FirstName & ' (' & Role & ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS >> FirstNames FROM tblFamily;) >> >> which returns >> >> FamID | famLastName | FirstNames >> 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), >> Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there are >> more than one Son or more animals? >> >> What I really need is very close to it but a little different So, I have >> to >> concatenate all the crew of a movie grouped by people specialty e.g. >> >> Title | crew >> Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, >> name5.... >> >> Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) >> name10, >> name11 >> >> I would appreciate it very much if you could help on that. >> Thank's a lot >> >> /kostas >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From kost36 at otenet.gr Wed Jan 24 14:17:50 2018 From: kost36 at otenet.gr (kost36 at otenet.gr) Date: Wed, 24 Jan 2018 22:17:50 +0200 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> Message-ID: <045d01d39550$6892a680$39b7f380$@otenet.gr> Not exactly Ryan, I am looking for Lastname | exp1 Hookom | Bob(Dad), Anne(Mom), Timmy (Son), Spot, Rover(Dog) Cranky, Biscuit(Cat) Group by role if exists more than one -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Ryan W Sent: Wednesday, January 24, 2018 10:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Concatenate seaparated by " ," and group by Isn't this what you're looking for? https://i.imgur.com/ymHsnRo.png Here's my code using ConcatRelated SELECT Table1.LastName, ConcatRelated("[FirstName] & '(' & [Role] & ')'","Table1","LastName = '" & [LastName] & "'") AS Expr1 FROM Table1; On Wed, Jan 24, 2018 at 1:33 PM, Jim Dettman wrote: > > Think that would depend more on the table/query design. > > Another Concat function: > > https://www.experts-exchange.com/articles/2380/Domain- > Aggregate-for-Concaten > ating-Values-by-Group-in-Microsoft-Access.html > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of kost36 at otenet.gr > Sent: Wednesday, January 24, 2018 1:56 PM > To: 'Access Developers discussion and problem solving' > Subject: [AccessD] Concatenate seaparated by " ," and group by > > Dear all, > Does anybody have ever used any kind of any concatenate function > supporting "group by" in the same record too? > Something familiar with what I need is Duane Hookom's, 2003 > Concatenate function specially his example on the query Example of > First Names and Roles in Family SELECT tblFamily.FamID, > tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & > ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM > tblFamily;) > > which returns > > FamID | famLastName | FirstNames > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there > are more than one Son or more animals? > > What I really need is very close to it but a little different So, I > have to concatenate all the crew of a movie grouped by people specialty e.g. > > Title | crew > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > name5.... > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) > name10, > name11 > > I would appreciate it very much if you could help on that. > Thank's a lot > > /kostas > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kost36 at otenet.gr Wed Jan 24 14:18:20 2018 From: kost36 at otenet.gr (kost36 at otenet.gr) Date: Wed, 24 Jan 2018 22:18:20 +0200 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: <00b501d3954a$44948920$cdbd9b60$@verizon.net> References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> Message-ID: <045f01d39550$7a72e9f0$6f58bdd0$@otenet.gr> Thank;s Jim -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Wednesday, January 24, 2018 9:34 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Concatenate seaparated by " ," and group by Think that would depend more on the table/query design. Another Concat function: https://www.experts-exchange.com/articles/2380/Domain-Aggregate-for-Concaten ating-Values-by-Group-in-Microsoft-Access.html Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of kost36 at otenet.gr Sent: Wednesday, January 24, 2018 1:56 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Concatenate seaparated by " ," and group by Dear all, Does anybody have ever used any kind of any concatenate function supporting "group by" in the same record too? Something familiar with what I need is Duane Hookom's, 2003 Concatenate function specially his example on the query Example of First Names and Roles in Family SELECT tblFamily.FamID, tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM tblFamily;) which returns FamID | famLastName | FirstNames 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there are more than one Son or more animals? What I really need is very close to it but a little different So, I have to concatenate all the crew of a movie grouped by people specialty e.g. Title | crew Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, name5.... Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) name10, name11 I would appreciate it very much if you could help on that. Thank's a lot /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From wrwehler at gmail.com Wed Jan 24 14:40:46 2018 From: wrwehler at gmail.com (Ryan W) Date: Wed, 24 Jan 2018 14:40:46 -0600 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: <045d01d39550$6892a680$39b7f380$@otenet.gr> References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> <045d01d39550$6892a680$39b7f380$@otenet.gr> Message-ID: Oh my mistake. I'll ponder more. On Wed, Jan 24, 2018 at 2:17 PM, wrote: > Not exactly Ryan, > I am looking for > > Lastname | exp1 > Hookom | Bob(Dad), Anne(Mom), Timmy (Son), Spot, Rover(Dog) Cranky, > Biscuit(Cat) > > Group by role if exists more than one > > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Ryan W > Sent: Wednesday, January 24, 2018 10:06 PM > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Concatenate seaparated by " ," and group by > > Isn't this what you're looking for? > > https://i.imgur.com/ymHsnRo.png > > Here's my code using ConcatRelated > > > SELECT Table1.LastName, ConcatRelated("[FirstName] & '(' & [Role] & > ')'","Table1","LastName = '" & [LastName] & "'") AS Expr1 FROM Table1; > > > > > On Wed, Jan 24, 2018 at 1:33 PM, Jim Dettman > wrote: > > > > > Think that would depend more on the table/query design. > > > > Another Concat function: > > > > https://www.experts-exchange.com/articles/2380/Domain- > > Aggregate-for-Concaten > > ating-Values-by-Group-in-Microsoft-Access.html > > > > Jim. > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of kost36 at otenet.gr > > Sent: Wednesday, January 24, 2018 1:56 PM > > To: 'Access Developers discussion and problem solving' > > Subject: [AccessD] Concatenate seaparated by " ," and group by > > > > Dear all, > > Does anybody have ever used any kind of any concatenate function > > supporting "group by" in the same record too? > > Something familiar with what I need is Duane Hookom's, 2003 > > Concatenate function specially his example on the query Example of > > First Names and Roles in Family SELECT tblFamily.FamID, > > tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & > > ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM > > tblFamily;) > > > > which returns > > > > FamID | famLastName | FirstNames > > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > > Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there > > are more than one Son or more animals? > > > > What I really need is very close to it but a little different So, I > > have to concatenate all the crew of a movie grouped by people specialty > e.g. > > > > Title | crew > > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > > name5.... > > > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) > > name10, > > name11 > > > > I would appreciate it very much if you could help on that. > > Thank's a lot > > > > /kostas > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bensonforums at gmail.com Wed Jan 24 14:52:13 2018 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 24 Jan 2018 15:52:13 -0500 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: <045d01d39550$6892a680$39b7f380$@otenet.gr> References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> <045d01d39550$6892a680$39b7f380$@otenet.gr> Message-ID: Spot, Rover (dog) means 2 items with (dog) or a single dog? If On Jan 24, 2018 3:19 PM, wrote: > Not exactly Ryan, > I am looking for > > Lastname | exp1 > Hookom | Bob(Dad), Anne(Mom), Timmy (Son), Spot, Rover(Dog) Cranky, > Biscuit(Cat) > > Group by role if exists more than one > > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Ryan W > Sent: Wednesday, January 24, 2018 10:06 PM > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Concatenate seaparated by " ," and group by > > Isn't this what you're looking for? > > https://i.imgur.com/ymHsnRo.png > > Here's my code using ConcatRelated > > > SELECT Table1.LastName, ConcatRelated("[FirstName] & '(' & [Role] & > ')'","Table1","LastName = '" & [LastName] & "'") AS Expr1 FROM Table1; > > > > > On Wed, Jan 24, 2018 at 1:33 PM, Jim Dettman > wrote: > > > > > Think that would depend more on the table/query design. > > > > Another Concat function: > > > > https://www.experts-exchange.com/articles/2380/Domain- > > Aggregate-for-Concaten > > ating-Values-by-Group-in-Microsoft-Access.html > > > > Jim. > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of kost36 at otenet.gr > > Sent: Wednesday, January 24, 2018 1:56 PM > > To: 'Access Developers discussion and problem solving' > > Subject: [AccessD] Concatenate seaparated by " ," and group by > > > > Dear all, > > Does anybody have ever used any kind of any concatenate function > > supporting "group by" in the same record too? > > Something familiar with what I need is Duane Hookom's, 2003 > > Concatenate function specially his example on the query Example of > > First Names and Roles in Family SELECT tblFamily.FamID, > > tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & > > ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM > > tblFamily;) > > > > which returns > > > > FamID | famLastName | FirstNames > > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > > Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if there > > are more than one Son or more animals? > > > > What I really need is very close to it but a little different So, I > > have to concatenate all the crew of a movie grouped by people specialty > e.g. > > > > Title | crew > > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > > name5.... > > > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) > > name10, > > name11 > > > > I would appreciate it very much if you could help on that. > > Thank's a lot > > > > /kostas > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jimdettman at verizon.net Wed Jan 24 15:00:03 2018 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 24 Jan 2018 16:00:03 -0500 Subject: [AccessD] On another note.... Message-ID: <001d01d39556$4f1fb340$ed5f19c0$@verizon.net> On another note, some of you may be interested in this: https://www.experts-exchange.com/articles/31440/Supporting-serial-communicat ion-devices-in-Microsoft-Access-without-the-use-of-ActiveX-controls.html Which I just posted on EE and linked In but forgot to post it here. Actually come to think of it, I don't think I ever mentioned this one either: https://www.experts-exchange.com/articles/28861/Obtaining-an-object-variable -for-a-running-instance-of-Microsoft-Access.html Those two are on some pretty arcane subjects, but some might find a need as we have a pretty eclectic group here. Jim. From kost36 at otenet.gr Wed Jan 24 15:11:06 2018 From: kost36 at otenet.gr (kost36 at otenet.gr) Date: Wed, 24 Jan 2018 23:11:06 +0200 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> <045d01d39550$6892a680$39b7f380$@otenet.gr> Message-ID: <047c01d39557$d99bb4f0$8cd31ed0$@otenet.gr> Yes Bill, it means 2 dogs -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Wednesday, January 24, 2018 10:52 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Concatenate seaparated by " ," and group by Spot, Rover (dog) means 2 items with (dog) or a single dog? If On Jan 24, 2018 3:19 PM, wrote: > Not exactly Ryan, > I am looking for > > Lastname | exp1 > Hookom | Bob(Dad), Anne(Mom), Timmy (Son), Spot, Rover(Dog) Cranky, > Biscuit(Cat) > > Group by role if exists more than one > > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Ryan W > Sent: Wednesday, January 24, 2018 10:06 PM > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Concatenate seaparated by " ," and group by > > Isn't this what you're looking for? > > https://i.imgur.com/ymHsnRo.png > > Here's my code using ConcatRelated > > > SELECT Table1.LastName, ConcatRelated("[FirstName] & '(' & [Role] & > ')'","Table1","LastName = '" & [LastName] & "'") AS Expr1 FROM Table1; > > > > > On Wed, Jan 24, 2018 at 1:33 PM, Jim Dettman > wrote: > > > > > Think that would depend more on the table/query design. > > > > Another Concat function: > > > > https://www.experts-exchange.com/articles/2380/Domain- > > Aggregate-for-Concaten > > ating-Values-by-Group-in-Microsoft-Access.html > > > > Jim. > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of kost36 at otenet.gr > > Sent: Wednesday, January 24, 2018 1:56 PM > > To: 'Access Developers discussion and problem solving' > > Subject: [AccessD] Concatenate seaparated by " ," and group by > > > > Dear all, > > Does anybody have ever used any kind of any concatenate function > > supporting "group by" in the same record too? > > Something familiar with what I need is Duane Hookom's, 2003 > > Concatenate function specially his example on the query Example of > > First Names and Roles in Family SELECT tblFamily.FamID, > > tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & > > ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM > > tblFamily;) > > > > which returns > > > > FamID | famLastName | FirstNames > > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > > Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if > > there are more than one Son or more animals? > > > > What I really need is very close to it but a little different So, I > > have to concatenate all the crew of a movie grouped by people > > specialty > e.g. > > > > Title | crew > > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > > name5.... > > > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) > > name10, > > name11 > > > > I would appreciate it very much if you could help on that. > > Thank's a lot > > > > /kostas > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Thu Jan 25 08:56:03 2018 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Thu, 25 Jan 2018 06:56:03 -0800 Subject: [AccessD] On another note.... In-Reply-To: <001d01d39556$4f1fb340$ed5f19c0$@verizon.net> References: <001d01d39556$4f1fb340$ed5f19c0$@verizon.net> Message-ID: Thanks, Jim. Both those are keepers! Charlotte Foust (916) 206-4336 On Wed, Jan 24, 2018 at 1:00 PM, Jim Dettman wrote: > > > On another note, some of you may be interested in this: > > > > https://www.experts-exchange.com/articles/31440/Supporting- > serial-communicat > ion-devices-in-Microsoft-Access-without-the-use-of-ActiveX-controls.html > > > > Which I just posted on EE and linked In but forgot to post it here. > Actually come to think of it, I don't think I ever mentioned this one > either: > > > > https://www.experts-exchange.com/articles/28861/Obtaining- > an-object-variable > -for-a-running-instance-of-Microsoft-Access.html > > > > Those two are on some pretty arcane subjects, but some might find a need as > we have a pretty eclectic group here. > > > > Jim. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From kost36 at otenet.gr Sat Jan 27 06:00:24 2018 From: kost36 at otenet.gr (kost36 at otenet.gr) Date: Sat, 27 Jan 2018 14:00:24 +0200 Subject: [AccessD] Concatenate seaparated by " ," and group by In-Reply-To: <047c01d39557$d99bb4f0$8cd31ed0$@otenet.gr> References: <043601d39544$f4d6a9e0$de83fda0$@otenet.gr> <00b501d3954a$44948920$cdbd9b60$@verizon.net> <045d01d39550$6892a680$39b7f380$@otenet.gr> <047c01d39557$d99bb4f0$8cd31ed0$@otenet.gr> Message-ID: <017c01d39766$6a652bf0$3f2f83d0$@otenet.gr> solved with crystal's precious help on experts-exchange... https://www.experts-exchange.com/questions/29080319/Help-on-Patrick-Matthews -DConcat-function.html thank's you all too -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of kost36 at otenet.gr Sent: Wednesday, January 24, 2018 11:11 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Concatenate seaparated by " ," and group by Yes Bill, it means 2 dogs -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Wednesday, January 24, 2018 10:52 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Concatenate seaparated by " ," and group by Spot, Rover (dog) means 2 items with (dog) or a single dog? If On Jan 24, 2018 3:19 PM, wrote: > Not exactly Ryan, > I am looking for > > Lastname | exp1 > Hookom | Bob(Dad), Anne(Mom), Timmy (Son), Spot, Rover(Dog) Cranky, > Biscuit(Cat) > > Group by role if exists more than one > > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Ryan W > Sent: Wednesday, January 24, 2018 10:06 PM > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Concatenate seaparated by " ," and group by > > Isn't this what you're looking for? > > https://i.imgur.com/ymHsnRo.png > > Here's my code using ConcatRelated > > > SELECT Table1.LastName, ConcatRelated("[FirstName] & '(' & [Role] & > ')'","Table1","LastName = '" & [LastName] & "'") AS Expr1 FROM Table1; > > > > > On Wed, Jan 24, 2018 at 1:33 PM, Jim Dettman > wrote: > > > > > Think that would depend more on the table/query design. > > > > Another Concat function: > > > > https://www.experts-exchange.com/articles/2380/Domain- > > Aggregate-for-Concaten > > ating-Values-by-Group-in-Microsoft-Access.html > > > > Jim. > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > Behalf Of kost36 at otenet.gr > > Sent: Wednesday, January 24, 2018 1:56 PM > > To: 'Access Developers discussion and problem solving' > > Subject: [AccessD] Concatenate seaparated by " ," and group by > > > > Dear all, > > Does anybody have ever used any kind of any concatenate function > > supporting "group by" in the same record too? > > Something familiar with what I need is Duane Hookom's, 2003 > > Concatenate function specially his example on the query Example of > > First Names and Roles in Family SELECT tblFamily.FamID, > > tblFamily.famLastName, Concatenate("SELECT FirstName & ' (' & Role & > > ')' FROM tblFamMem WHERE FamID =" & [FamID]) AS FirstNames FROM > > tblFamily;) > > > > which returns > > > > FamID | famLastName | FirstNames > > 1 | Hookom | Duane (Dad), Laura (Mom), Jake (Son), > > Chelsey (Daughter), Dakota (Dog), Josie (Cat) But what about if > > there are more than one Son or more animals? > > > > What I really need is very close to it but a little different So, I > > have to concatenate all the crew of a movie grouped by people > > specialty > e.g. > > > > Title | crew > > Title1 | (Director:) name1, name2 if exist (Actor:) name3, name4, > > name5.... > > > > Title2 | (Director:) name6 (Actor:) name7, name8, name9, (Script:) > > name10, > > name11 > > > > I would appreciate it very much if you could help on that. > > Thank's a lot > > > > /kostas > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com