Search results

  1. B

    Check if field exists - SQL

    What error is it throwing? This statement is confusing. Are you trying to use this function on tables or queries?
  2. B

    Use MS Access to Extract Outlook Calendar Appointments

    Try changing the following code: strRestriction = "[Start] >= '" & Format(Date, "mm/dd/yyyy hh:mm AMPM") _ & "' AND [Start] <= '" & Format(Date + 14, "mm/dd/yyyy hh:mm AMPM") & "'"
  3. B

    Formatting of Euro Currency

    You might try this code instead: Function E2UK(ByVal x As String) As Double Dim d ' Decimal Placeholder Dim t ' Thousand Placeholder Dim c ' Currency Test String Dim i As Long ' String Position ' Generate test Currency string to extrapolate the ' User's Locale Decimal...
  4. B

    Hide Runtime Window Question

    The forms can be opened non-modal, provides that the forms' PopUp property is set to True.
  5. B

    Nz() function does not work with Excel

    Hello, bephraim, You're solution will not work if Value1 truly is Null. Try this function in Excel instead: Public Function Nz(ByVal Value, Optional ByVal ValueIfNull = "") Nz = IIf(IsNull(Value), ValueIfNull, Value) End Function
  6. B

    Automation Error using mde made from another pc

    Hello, FuzMic, If one of the machines has Service Pack 1 and the other machine does not, they will have different IID's. When an MDE is compiled, any VBA code references to ADODB objects are converted to their IID equivalents. Consequently, if that MDE is compiled on a Windows 7 SP1 machine...
  7. B

    Update Query - Multiple Fields

    Yes, there is. You can try the following SQL syntax (substitute highlighted items with actual table/field names): UPDATE MyTable SET Field1 = NULL, Field2 = NULL, Field3 = NULL, Field4 = NULL, Field5 = NULL, Field6 = NULL WHERE NOT ( Field1 = 'CT' OR Field2 =...
  8. B

    Why does this delete query run forever?

    Try this: DELETE * FROM Table1 WHERE NOT EXISTS ( SELECT Table2.Field1 FROM Table2 WHERE Table2.Field1 = Table1.Field1);
  9. B

    Can Access application have multi-languages?

    If all you are looking for is a way to determine in what language labels and messages should be displayed, you can do this in VBA quite easily with the GetUserDefaultUILanguage Windows API. Study the code examples below. Once you become more familiar with VBA it will become immediately...
  10. B

    Hanging Excel process

    You might try the following amended code: MsgBox "-1" Set Xl = New Excel.Application MsgBox "0" Set XLBook = Xl.Workbooks.Open(strImportFile) MsgBox "1" XLBook.SaveAs Replace(XLBook.FullName, ".csv", ".xlsm"), 52 ' Save the CSV file as an Excel file XLBook.Saved = True MsgBox...
  11. B

    Help to enable or lock fields regarding a combo box

    You can change the Sub to a Function, as shown below. Then you can set the After Update property of cboIDEstado to: =SetformState() Function SetformState() Dim State As AlbaranState If (Me.cboIDEstado.Value = 1) Then State = New_Albaran ElseIf (Me.cboIDEstado.Value = 2)...
  12. B

    Compile Error

    Try changing: If (NotIsNull(ExceptionID)) Then ...to: If IsNull(ExceptionID) = False Then
  13. B

    CommandBars

    Q1 Answer: If you use a Macro for your menu, I do not believe that it appears in the CommandBars collection. Q2 Answer: If you make the following change in your code, you do not require the reference to the Microsoft Office 12.0 Object Library: Dim CB As Object, crl As Object
  14. B

    Deleting duplicate table entries leaving 1

    If the Key field-pair is xDate and Country, and if you only want to retain the records with the lowest ID value for each xDate and Country, then you can try a delete query like the following: DELETE * FROM SpecialDates WHERE SpecialDates.id > ( SELECT MIN(S2.id) FROM SpecialDates AS S2...
  15. B

    Help Error 3146 ODBC call failed

    You might try enumerating the DBEngine.Errors for more detailed information on that specific computer. Example: errregfail: Dim vError As Variant For Each vError In DBEngine.Errors MsgBox "An error has occurred and I was not able to create the DSN. " & vbCrLf & _ "Error: " &...
  16. B

    VBA Code: Disable right click

    To disable right-click on a form via VBA code, use the following syntax: Forms("MyForm").ShortcutMenu = False
  17. B

    Weird White Space Character From Excel File

    Instead of: Trim([Tracker].[PromoDesc]) ...you might try: Trim(Replace([Tracker].[PromoDesc], Chr(160), " ", 1, -1, 1))
  18. B

    Inventory for multiple locations

    I have seen Inventory databases that managed inventory grouped by Part, Warehouse and Storage Location. Here is some sample table/query architecture that may help you with your approach: tblWarehouse --------------- whCode whDescription whCode | whDescription -------+------------------ MAIN...
  19. B

    How to delete records based on another table

    You might try something like: DELETE FROM smallTab WHERE NOT EXISTS ( SELECT f1 FROM bigTab WHERE bigTab.f1 = smallTab.f1);
  20. B

    Null values Building Strings

    You might try the following code revision after the If rs.RecordCount > 0 Then statement: rs.MoveFirst Do If Not IsNull(rs!RName) Then If Not IsNull(rs!SubjectEMail) Then vRecipientList = vRecipientList & rs!SubjectEMail & ";" End If If Not...
Back
Top Bottom