Search results

  1. A

    Question Insert data from one table into a different field in another table

    Gentlemen I added a WHERE statement and everything worked. Here is my edited code. db.Execute "INSERT INTO tbl_SumMonth ([Credit]) SELECT tbl_TmpTrans_ByDate.[Total_Amount]" & _ " FROM tbl_TmpTrans_ByDate" & _ " WHERE tbl_TmpTrans_ByDate.[NQCG_Month] = 'Jan-19';" MsgBox "Table tbl_SumMonth...
  2. A

    Question Insert data from one table into a different field in another table

    I have a table tbl_TmpTrans_ByDate with the following data NQCG_Month Category Total_Amout Jan-19 Credit $220 And I have a master table tbl_SumMonth with fields NQCG_Month Credit Debit ...........etc I want to insert into the credit field in tbl_SumMonth the...
  3. A

    Sum Total data and Save to a table with VBA

    ypma It works exactly the way I wanted to. Thanks again
  4. A

    Sum Total data and Save to a table with VBA

    ypma My apologies. I did not see the attachment NewTest.accdb. This does what I want. Thank you
  5. A

    Sum Total data and Save to a table with VBA

    ypma I made an attempt at your suggestion but crashes on the Set rs = db.OpenRecordset(strSQL). The make Table works but the first section crashes. What do you think is wrong with my code. Private Sub cmd_SumQry_Click() Dim db As Database Dim rs As DAO.Recordset Dim strQry As String Dim...
  6. A

    Sum Total data and Save to a table with VBA

    This is my test data (qry_Income_ByDate) NQCG_Month Category Amount Jan-19 Credit $70 Jan-19 Credit $20 Jan-19 Debit $245 Jan-19 Credit $60 I want to perform the following: 1. DSum the [Amount] according...
  7. A

    CREATE TABLE within VBA

    Thank you all as the entire input discussion as it has been very intuitive. Gina Whipp you minor change worked a treat but Doc Man raised an interesting point about "DB Bloat". Something I was not aware of and this escalated the discussion into "Side-ends" and ended with a very interesting...
  8. A

    Tip The Ten Commandments of Access

    I love it oh "Wise Man". I shall abide by your commandments
  9. A

    CREATE TABLE within VBA

    I want to create a temporary table with the SQL "CREATE TABLE" option within VBA and use the Execute command instead of DoCmd.RunSQL. I just want the Table structure without any records. The code fails on the Execute command. I can not see anything wrong with this code. Please help Dim db As...
  10. A

    Substituting a record into a DoCmd

    Thank you all for your help especially Cronk. I have solved my problem. It took me a while to realise that the Hyperlinks were causing my problem. Thanks again
  11. A

    Substituting a record into a DoCmd

    Anyone Will this Dlookup work if the field "Email" is in the table as a hyperlink field ' Email report to each club member ********* Dim strEmail As String strEmail = DLookup("Email", "qry_receipts") ' strEmail = "resval@iinet.net.au" DoCmd.SendObject acReport, strReport, acFormatPDF...
  12. A

    Substituting a record into a DoCmd

    Cronk I am using Outlook as my email host
  13. A

    Substituting a record into a DoCmd

    Cronk I got the DLookup to work for a simple field like "Last_Name" in another script but could not get it to work for an email address. When I substituted the Dlookup .... for a real email address it worked. Is there something different about email addresses in a Dlookup? ' Email report to...
  14. A

    Substituting a record into a DoCmd

    Thank you everyone for your replies. I am about to work through your suggestions and I will get back to you shortly
  15. A

    Substituting a record into a DoCmd

    I have a query (qry_receipts) which contains the members email addresses. I can create an individual receipt (rpt_receipts) for each member and then I want to be able to email their receipt as a PDF to only that member. This means that the members email address created by the query (tempQry)...
  16. A

    Example of crosstab query in VBA for Access 2010

    Can anybody please helop me with the syntax with this crosstab query in Access 2010. It will not work. Private Sub cmd_SumBogger_Click() Dim strCrosstabQuery As String Dim strMakeQuery As String Dim strUpdateQuery As String DoCmd.SetWarnings False ' turns off popup warnings strCrosstabQuery = "...
  17. A

    Update a table from a query using VBA

    Thank you for your reply. Yes it did help
  18. A

    Update a table from a query using VBA

    Can someone please help. I am using Access 2010. I need to update data in a table of 5 fields from a query but I need to do this with VBA code or even using the SQL update command within the VBA code.
  19. A

    Save an expression within a query back to a table

    Trevor G Thank you for your help. This worked fine. The only problem I encountered was that the expression data which appeared in the new created table was double precision and consisted of 11 decimal places. I changed it to single precision with 2 decimal places and the next time I ran the Make...
Top Bottom