Search results

  1. T

    Send email via GMail

    I need to send email using GMail and have the following code: Public Sub SendEmailGmail() Dim NewMail As CDO.Message Dim mailConfig As CDO.Configuration Dim fields As Variant Dim msConfigURL As String Dim db As DAO.Database Dim rstAttachments As DAO.Recordset Dim rstGmailSettings As...
  2. T

    Insert Into Syntax issue

    I have been staring at this for hours and can't see the syntax problem CurrentDb.Execute "INSERT INTO tblBackEndLocation(BackendLocation, ComputerDescription, dDate) VALUES " & _ "('" & pubFilePathName & "', '" & strQuestion & "', #" & Now() & "#)", dbFailOnError...
  3. T

    Search By Time

    I have the table "tblTempTrainingDateTime" It contains the fields: TrainingTimeId - AutoNumber TrainingTime - Date/Time & Format = Short Time I have a record where the TrainingTime = 10:00:00 Why does the following return a null value? lngTrainingTimeId = DLookup("TrainingTimeId"...
  4. T

    Reduce repetive code on multiple forms

    On a form I have the following code Private Sub ShowCustomerContactDetailsForm() Forms![frmCustomer]![frmCustomerContacts].Form!lngCustomerContactId = Forms![frmCustomer]![frmCustomerContacts].Form!lstCustomerContacts.ItemData(0)...
  5. T

    Merge records from 2 queries as one record in a new query

    I posted a question earlier on how to return first and last dates by year: https://access-programmers.co.uk/forums/showpost.php?p=1614857&postcount=1 Colin (isladogs) kindly solved this for me. In his solution, the Union query returns 2 records. One for the first date, and one for the last date...
  6. T

    Query to return first and last dates by year

    I have a table with the fields: dDate and Value The table has numerous records spanning many years I need a query that will return the first and last date for each year. e.g 1/1/2016 15/11/2016 4/2/2017 30/12/2017 3/1/2018 30/11/2018 How do I do this? Thanks in advance
  7. T

    Stop looping through Excel rows

    I use the following to loop though rows in an Excel spreadsheet For Row = 1 To CountRow code that checks value in cell Next Row If the code checking the value in the cell meets certain criteria, I want to stop the loop. How do I do this? Thanks
  8. T

    Convert string to date

    I have the string: 01 April 2016 How do I convert it to a date, in the format: 01/04/2016? Need to cater for all months of the year! Thanks
  9. T

    Filter Recordsets

    I have a dao.recordset called "rstPurchaseOrder" which contains SupplierId, ProductId & CurrencyId which I want to use to create purchase orders. I need create a purchase orders for each supplier and currency. Each purchase order may only have one currency. How do I loop & filter the recordset...
  10. T

    Matched Query

    I am looking for a query that will return records from a table that have related records in another table. Opposite to the Unmatched Query Wizard I have two tables: tblSupplier and tblSupplierProducts The two tables are related by the field "SupplierId" I need the query to only return...
  11. T

    Filter list box on form by using a control on the form

    On a form I have a: control called "FilterListBox" list box called "lstCustomer" option Box called "optCustomerType" When the user selects an option in the option box, "FilterListBox" is updated to either "1", "2" or "1 or 2" One of the fields in the query for "lstCustomer" is "CustomerType"...
  12. T

    Freeze Panes in Excel from Access

    I need to freeze the panes in an Excel spreadsheet form within Access I have the following code: Dim ApXL As Object Dim xlWBk As Object Dim xlWSh As Object Set ApXL = CreateObject("Excel.Application") Set xlWBk = ApXL.Workbooks.Add Set xlWSh = xlWBk.Worksheets(1) With xlWSh.Range("B5")...
  13. T

    Formating cells in Excel

    I am using Access 2010 I need to format cells inside the Excel spreadsheet Here is my code Dim ApXL As Object Dim xlWBk As Object Dim xlWSh As Object Dim intColumn As Long Set ApXL = CreateObject("Excel.Application") ApXL.Application.ScreenUpdating = True ApXL.Visible = True Set xlWBk =...
  14. T

    Keep track of when form data has changed

    I want to keep track of when data in a form was last changed. I only need to track this when the form is closed. not every time a record is changed. What event should I use?
  15. T

    Query by form using "like"

    On a form I have a list box with the following recordset: SELECT tblCustomer.CustomerID, tblCustomer.CustomerName FROM tblCustomer WHERE (((tblCustomer.CustomerName) Like [Forms]![Form1]![txtCompanyName] & "*")) ORDER BY tblCustomer.CustomerName; Also on the form I have a text box called...
  16. T

    Form with dynamic number of columns

    I need to create a production forecast form based on previous sales history. The history is based a sales and grouped by month & year So on the form, which needs to be a continuous form, I want products to show as rows and months as columns The sales history per month needs to be displayed as...
  17. T

    Round to nearest 10 cents

    How can a I round to the nearest 10 cents e.g 10.04 = 10.00 10.06 = 10.10 10.28 = 10.30 ........ Thanks
  18. T

    Send command to RS-232 serial port

    Using Access 2010 How do I send the command "^G" to a device connected via serial port (RS-232) number 3? Many thanks
  19. T

    Grouping with only one record

    I have a report showing products and their selling prices Most products have only one selling price, however a few have more than one selling price To cater for this I have created a group called "Products" The selling prices are then in the reports' "details" section. Works well, except that...
  20. T

    Populate combo box with names of installed fonts

    I need to give users the ability to change the font of a field in a report. The field shows a barcode. I thought of using the CommonDlg class to show the Windows font-selecting dialog box, but installed barcode fonts show as a barcode. I need to show the font name. So I need to populate a...
Top Bottom