User Profile

Collapse

Profile Sidebar

Collapse
jforbes
jforbes
Last Activity: Aug 21 '17, 02:55 PM
Joined: Aug 19 '14
Location: Indianapolis, IN, USA
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Once you have srtCriteria filled out with the where clause, you should be able to do the following:
    Code:
    Me.Filter=srtCriteria
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Automation error and startup problems
    First thing is create a backup copy of your database.

    Try a compact and repair and see if the problem goes away

    If not:
    1. From the Run prompt enter "msaccess /decompile" and run it.
    2. recompile your database.


    That's all I have.
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Parsing SQL
    This looked like fun, so I created a function that might work for you. The idea is to pass it a list of SQL fields and it will return a Pipe Delimited string of just the fields that contain AS, while taking into account the nesting that happens with Parenthesis.

    Here is the code:
    Code:
    Public Function getDelimitedASFields(ByRef sSQL As String) As String
    
        Dim iCount As Integer
        Dim iStart As Integer
    ...
    See more | Go to post

    Leave a comment:


  • I haven't had a lot of experience with 2016 yet, but most of my troubles have come from going from 2007 to 2016.

    To try to make sure there is a clean upgrade/install, I use a clean test environment where the install can be performed and a regression test of all the functionality can be completed to minimize the problems during roll-out. I would highly recommend it. Even more so if you can get a business owner to do your regression...
    See more | Go to post

    Leave a comment:


  • Basically what you want to run is what they call a Worker Thread, which aren't available in Access. Multithreading: Creating Worker Threads

    So like most people, it's easier to work within Access' boundaries and with Access' tools. I use the Status Bar. I'll provide you with a stripped down version of my code.

    Code:
    ' This is on the MainMenu Form, which is always open.
    '----------------------------------------------------
    ...
    See more | Go to post

    Leave a comment:


  • I've always seen ADezii's suggestions and code work well, so you could easily continue with what he has provided and know you are going to get what you are asking for and he has provided a method to clean up the spreadsheet, which is exactly what you are asking for.

    But I feel that there is another option that should be at least considered.

    NeoPa touched on this when he mentioned having Access open Excel an file and...
    See more | Go to post

    Leave a comment:


  • I haven't developed an add-in in 8 or 9 years. When I did it was done using VSTO (Visual Studo Tools for Office)
    See more | Go to post

    Leave a comment:


  • Nice, I don't know why I kept the * in there. They just messed it up.
    See more | Go to post

    Leave a comment:


  • You can do this, but you'll be much better off if you Normalize your Data instead of having separate fields for Monday through Friday. I know this is not what you asked for, and you can do what your asking, but with every thing going forward that you attempt will be complicated if you don't have your database normalized first.

    This is a link that explains Normalization: Database Normalization and Table Structures
    See more | Go to post

    Leave a comment:


  • I think it's not working for you because there are a few things wrong with your SQL Statement.
    There's a typo around [em].
    Your using a Select statement instead of an Update Statement. Maybe your not trying to update the data, but without an Update Statement, you are just returning results.

    This is a shot at the correct syntax, but it's just a best guess:
    Code:
    UPDATE SCAN SET [px]=Replace([px],"*" & [em]
    ...
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to data from one form field to another
    A simple way to accomplish this is to set the .DefaultValue property of the field you want the value to carry over on during it's AfterUpdate Event.

    This is an example:
    Code:
    Private Sub TransDate_AfterUpdate()
            TransDate.DefaultValue = "#" & Me.TransDate.Value & "#"
    End Sub
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Open Form and Update List on Double-Click
    You may want to consider setting .AllowValueList Edits to True to bring up an editor when a value is entered that isn't in the list. You could also consider the .ListItemEditFo rm property if you want to supply the Form to perform the addition to the List.
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Display Query Results in Subform.
    Unless there is something I'm missing, create a SubForm and base it on the same Query you have your MainForm based on and it should work. You may need to Requery your SubForm when you change the Criteria.
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Public Locking VBA
    To convert a Private Function to Public Function:
    • Create a Module to store the Public Function, make sure the name of the Module is unique and not the same as the Public Function or it wont compile
    • Make sure to put "Option Explicit" at the Top of the Module
    • Paste the Private Function into the Module, and replace the Private Declaration with the Public One.
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Specific Date and Time calculation
    This is my take on it:
    Code:
    Public Function calcWorkMinutes(ByRef dStart As Date, ByRef dEnd As Date) As Long
        
        Dim dDay As Date
        Dim lMinutes As Long
        Dim lStartTime As Long
        Dim lEnddTime As Long
        
        dDay = dStart
        
        While dDay < dEnd
            Select Case DatePart("d", dDay) Mod 7
                Case 0
                    ' Sunday
    ...
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Error Handling: Incorrect Information Input
    Are you using a Keyboard-Wedge style scanner? If so, you might want to check into the Keydown Event (maybe Keypress) to capture the string of characters as they come in, instead of after it's moved focus all over your screen.
    See more | Go to post

    Leave a comment:


  • jforbes
    replied to Convert Access Expression to VBA
    The following is the basic structure I use for a Function that you want it callable from a Query:

    Code:
        'getSaveState
    Public Function getSaveState(sUser As Variant, sObject As Variant) As Variant
        On Error GoTo ErrorOut
    
        getSaveState = Nz(dlookup("State", "SaveState", "UserID='" & NZ(sUser, "") & "' AND Object='" & NZ(sObject, "") &
    ...
    See more | Go to post

    Leave a comment:


  • The United States Postal Service has a Web-service available to validate an address. Using the Web-service, you could use it's results as a way to find similar addresses. This is something that I've wanted to do in-house for years, but it hasn't become a high enough priority with our data.

    This is the link to the Web Tools API.
    See more | Go to post

    Leave a comment:


  • I think you are close, there might be a shorter, easier way to accomplish what you are doing, you can open a Form and supply it a Filter OnLoad. This will limit the Form to only showing the specific record. The following is my best guess for you based on what you provided:
    Code:
    Private Sub Listbox1_Click()
    Dim src As Integer
    Dim subfhis As String
    subfhis = "HISTORY"
    
    With Listbox1
    src = CLng(.Column(0))
    ...
    See more | Go to post

    Leave a comment:


  • In my experience, if you are providing a Filtering mechanism for your users, you need to provide the full range of user needs in your Filtering, and then hide or turn Access' UI filtering. Often the Form Property .AllowFilters is all you need.

    The two just do not get along and I've never seen anyone successfully get both to work on the same Form.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...