Search results

  1. B

    Format XML Date for import into Access

    You could more easily use: xmlFieldElement.Text = Format(dateTemp, "yyyy-mm-ddThh:mm:ss")
  2. B

    IsNull problem in query

    You might try a query like the following (substitute highlighted text with actual table/field/form names): SELECT MyTable.* FROM MyTable WHERE Nz([Forms]![MyForm]![MeetingLocation], MyTable.MeetingLocation) = MyTable.MeetingLocation AND Iif(IsDate([Forms]![MyForm]![From Date])=True...
  3. B

    sending text via command button to email

    You might try something like the following. Let's say you have a command button on your form named cmdSend. Set the button's On Click property to [Event Procedure]. Then, in the form's code module, paste the following code: Private Sub cmdSend_Click() ' NOTE: modify the recipient, subject...
  4. B

    Updating all form-stored SQL

    You could try an approach like the following in a global module: Public Sub formComboReplace() Dim frmName As String Dim ctl As Control Dim X As Long Dim sRowSource As String For X = 0 To CurrentDb.Containers("Forms").Documents.Count - 1 frmName =...
  5. B

    Open/Save As and Close Excel

    The OP never said that there was an export problem, only that there was a problem with importing an Excel spreadsheet from another source. That other source may not necessarily be another MS Access application; it could be something else altogether. There are a number of other applications...
  6. B

    Open/Save As and Close Excel

    Hello, Old Man Devin, That is a good way to export a query as a spreadsheet. However, 2wistd is talking about importing spreadsheets, not exporting them.
  7. B

    Empty combobox values when access form loads vba

    That explains it. When the form opens, the Form_Load code sets the combobox Rowsource to blank. However, the moment that the combobox gets the focus (i.e. User clicks on the combobox), the Combo1_Enter code is triggered, which populates the combobox Rowsource. Consequently, the combobox...
  8. B

    Empty combobox values when access form loads vba

    Wait a minute, your OnEnter code is referencing two different comboboxes, Combo1 and Select_CM. What is the name of the actual combobox with which you are concerned?
  9. B

    Empty combobox values when access form loads vba

    Is the combox RowSource being set by any other code in your access project?
  10. B

    Open/Save As and Close Excel

    You can use the following code to convert the file to XLSX format before importing: Public Sub SaveAsXLSX(ByVal sFilePath As String) Const xlOpenXMLWorkbook = 51 Dim xlApp As Object Dim xlBook As Object Set xlApp = CreateObject("Excel.Application") Set xlBook =...
  11. B

    Display Cell B1 value in Sheet1 of all the workbooks in a message box

    You might try something like the following: Public Sub B1Display(ByVal sDirectory As String) Dim xlApp As Object Dim xlBook As Object Dim xlSheet As Object Dim cFile As Collection Dim vFile As Variant Set cFile = New Collection vFile = Dir(sDirectory & "\*.xls*") Do While vFile > ""...
  12. B

    Empty combobox values when access form loads vba

    You will need to refresh the combobox thus: Private Sub Form_Load() combo1.RowSource = "" combo1.Requery End Sub
  13. B

    Change Access-function to SQL Server function

    Sorry, the return type should be type SMALLDATETIME, thus: CREATE FUNCTION dbo.RoundToHourParts ( @dteWorkingtime nvarchar(23), @x float) RETURNS smalldatetime AS BEGIN -- Declare the return variable here DECLARE @ResultVar smalldatetime; -- Add the T-SQL statements to compute the return...
  14. B

    Change Access-function to SQL Server function

    You might try: CREATE FUNCTION dbo.RoundToHourParts ( @dteWorkingtime nvarchar(23), @x float) RETURNS datetime AS BEGIN -- Declare the return variable here DECLARE @ResultVar datetime; -- Add the T-SQL statements to compute the return value here SELECT @ResultVar = CONVERT(datetime...
  15. B

    Updating the first row of duplicate records

    If you have properly indexed fields in both tables, the query should take no longer than 10 seconds to process 40,000 records. I created a model for the tables/fields you mentioned, with the following indexes: Table A ------- Primary Key: field ID Index1: fields userno, ticketno Table B...
  16. B

    Updating the first row of duplicate records

    You might try the following: UPDATE [Table A] AS TA1 INNER JOIN [Table B] AS TB ON TA1.userno = TB.userno AND TA1.ticketno = TB.ticketno SET TA1.Status = TB.Status WHERE TA1.ID = ( SELECT MIN(TA2.ID) FROM [Table A] AS TA2 WHERE TA2.userno = TA1.userno AND...
  17. B

    Is this Ms humour?

    Agreed. I find it useful to employ the access file for modelling a database and validating the model from the application, but I always upsize to a more truly secure platform like MS SQL for the BE before I deploy a production solution.
  18. B

    Is this Ms humour?

    Hello, spikepl, ChrisO, SmallTime is raising a legitimate concern. If a User can link to the MySysObjects table in the BE file and obtain the password thereby, then the BE is not truly secure. From the post I gather that SmallTime's inquiry is as to whether there is a way to truly secure this...
  19. B

    Query to delete duplicates?

    You might try something a little more performance-friendly, like an INNER JOIN to an inline subquery, something like the following: SELECT DISTINCT T1.ProductKey, T1.StoreKey, T1.UPC FROM [Copy of tblStoreProducts3] AS T1 INNER JOIN ( SELECT ProductKey, StoreKey FROM [Copy of...
  20. B

    Question VBA date conversion to SAP formats

    Hello, eatraas, First, you can make it much simpler thus: pp = Format(datefield, "dd.mm.yyyy") Second, SAP's internal date format is actually YYYYMMDD. Some of the RFC Function Modules do take date inputs in an external format, such as DD.MM.YYYY, but in truth, the external date format to use...
Back
Top Bottom