User Profile

Collapse

Profile Sidebar

Collapse
morganaj
morganaj
Last Activity: Dec 16 '14, 02:26 PM
Joined: Oct 9 '13
Location: Saskatoon, SK, Canada
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I tried that. The first time still produced a successful message without actually copying. The second time it went over. I didn't get an error message either time.
    See more | Go to post

    Leave a comment:


  • So this is working kind of. If I click it once it runs without an error, but will not copy the information. But, if I click it a second time it usually will copy it.

    I'm not sure if this has to do with my SQL, but I assume probably. I also removed the from clause, as until a record was created it didn't have a SHC_No which is the primary key that is linked to the form. This seemed to work... like I said not 100% of the time. And I'm...
    See more | Go to post

    Leave a comment:


  • Thank you Seth, that ran the SQL without error. Though I also had to remove the quotes around FROM. I forgot that it was a statement SELECT x FROM x.
    See more | Go to post

    Leave a comment:


  • SQL "SELECT INTO" to Copy Sponsor Contact Info to Manager Info if they are the same.

    Hello All,

    I have a form to enter contact information, and often the sponsor info and the manager info is the same contact info. I am trying to use VBA to copy the information over to save me a bunch of time.

    This is what I have:

    Code:
    Private Sub Command28_Click()
    
    'VBA to copy all manager info to matching sponsor.
    
    On Error GoTo Err_Button_Click
    Dim ssql
    ...
    See more | Go to post

  • I figured this out by crawling around the depths of the Internet.

    Either in the criteria section of the query builder use:

    Code:
    Like Iif(IsNull([PARAMETER NAME TO POP]), "*",[PARAMETER NAME TO POP])
    This states that if the Parameter is null to use a wildcard to return all fields, else use what was entered by the user.

    You can also edit in the WHERE clause of the SQL:
    Code:
    WHERE FieldtoFilter
    ...
    See more | Go to post
    Last edited by zmbd; Jan 9 '14, 05:29 PM. Reason: [OP:Clarity.][z{Placed code tags}]

    Leave a comment:


  • When you build your query, you have to either build in parameters (criteria section) to filter the query that feeds to the report.

    Alternatively in the criteria sections you can enclose a string in square brackets, for example:

    [Enter What you are hoping to filter]

    This will bring a modal pop-up to have the user enter the criteria to filter on. I hope this makes sense. Let me know if you have any more issu...
    See more | Go to post

    Leave a comment:


  • Access 2007 - Select Query w/User-entered Parameters - "Is Null" or "Is Not Null"

    Hello Ladies and Gents,

    I have created a query in MS Access 2007. I want to be able to have the user define more than one parameter. If I have only one parameter AKA Year or PMC Name, the select query runs fine. But, I would like the user to have the option of defining more than one.

    But wait, its more complicated. I also want the user to be able to not define the parameter (leave it blank) to retrieve all the years...
    See more | Go to post

  • Also to solve your rounding issue you can use, which rounds to two places:

    Code:
    Expression Name: Round(([Value1]+[Value2]),2)
    Whatever you put as a value of AnyNumber is the decimal places to round to.

    Code:
    Round(NumbersOrExpression,AnyNumber)
    See more | Go to post
    Last edited by morganaj; Jan 7 '14, 06:15 PM. Reason: Clarity

    Leave a comment:


  • Hey zmbd, thanks for the help. I figured it out.

    Code:
    "SELECT TOP" & " " & Me.strPercent & " " & " PERCENT
    Apparently the syntax wanted a literal space to make it run properly.

    Thanks for the help!
    See more | Go to post

    Leave a comment:


  • When I try to change the SELECT statement to include the variable, that you suggested.

    Code:
     strSQL = "SELECT TOP" & Me.strPercent & "PERCENT tblTemp.SHC_No, tblTemp.Project_Name, tblTemp.Program_Type, tblTemp.PMC " &
                    "INTO " & strTableName & " " & _
                    "FROM tblTemp " & _
                    "ORDER BY tblTemp.Ra
    ...
    See more | Go to post

    Leave a comment:


  • morganaj
    started a topic Using a form to input for TOP x PERCENT in VBA

    Using a form to input for TOP x PERCENT in VBA

    Hello,

    I am trying to use this form:
    [IMGnothumb]http://i.imgur.com/06RWh0Y.jpg[/IMGnothumb]

    to select a program type and generate a random list to audit. This part is working correctly. But I would like to use a variable either a number or a percent to input as the TOP x PERCENT|NUMBER in my SQL statement from the form.

    My code looks like this:
    Code:
    strTableName = "tblAuditSample_"
    ...
    See more | Go to post
    Last edited by zmbd; Dec 10 '13, 03:40 PM. Reason: [z[cleard thumbnail.]}

  • VB Coding - Combo Box Auto Populate Error - Trying to select an item in a combo box t

    Hello,

    I am trying to get it so on after an update of a combo box that three other fields are to be filled in.

    I have the Control Source set to the Primary Key field of the table for the Contact.

    With the Row Source Type set to Table/Query. It is based off a query with the first field in the grid the primary key.

    I have set the properties to:
    Bound Column should be 1
    Change...
    See more | Go to post
    Last edited by zmbd; Oct 9 '13, 05:35 PM. Reason: [Rabbit{Please use [CODE] and [/CODE] tags when posting code or formatted data.}][z{placed [/code] tag at end of block}]
No activity results to display
Show More
Working...