User Profile

Collapse

Profile Sidebar

Collapse
MikeTheBike
MikeTheBike
Last Activity: Jan 27 '25, 12:17 PM
Joined: Jun 6 '07
Location: Derbyshire, UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi NeoPa

    Yes, in my experience since the days of office 97 to before ribbons were forced on us in 2007, Toolbars created in code don't seem to exist until the code creating them has run, which makes sense. Although toolbars so created will now appear on an Addin tab. I now define my own ribbons not toolbars, but the short cut menus still work as the y did pre-ribbons. It is inconvenient having to run the creating code before they...
    See more | Go to post

    Leave a comment:


  • Hi All

    I have never used 365 so this may be irrelevant, but I suspect not.

    Have you set the Shortcut Menu Bar property for the Form or Control in the properties Other Tab.

    The code creating the shortcuts will need running ij the session before they appear inthe list for selection.

    HTH

    MTB
    See more | Go to post

    Leave a comment:


  • Hi Sue

    Just a thought, is the droplist column count set to 4?

    MTB
    See more | Go to post

    Leave a comment:


  • MikeTheBike
    replied to Dlookup check
    Hi All

    Long time since I posted here!

    Not withstanding the previous replies, may I suggest this or similar may help

    Code:
    If DCount("[field]", "Table", "[field] = " & Me.Txt_field) >= 1 Then
       'found it
    Else
       'didnt find it
    End If
    As you just need to know if it exist (at least once), I would use DCount() as DLookUp() will return...
    See more | Go to post

    Leave a comment:


  • Hi Jeremy

    I assume that [Case Log ID] is a text field.

    as [Forms]![Import_FRM]![CaseLogIDTXT] will be trated as a string literal in VBA and not recongnised as the for control value, replace this
    Code:
    "WHERE ((([Outreach Data].[Case Log ID]) Like[Forms]![Import_FRM]![CaseLogIDTXT]));""
    with this. Note, text criteria need delimiting with either quotes or an apostrophies.
    Code:
    "WHERE ((([Outreach
    ...
    See more | Go to post

    Leave a comment:


  • MikeTheBike
    replied to Cursor position on entering text box
    Hi

    Not sure if this is relevant to your situation, but there is a setting in Options -> Advanced where you can set the default 'Behaviour entering field' to: Select entire field, Go to start of field or Go to end of field.

    This is in A2007 (should be similar in later versions?).

    HTH


    MTB

    ps: textbox (and others?) have .SelStart, .SelText and .SelLength properties...
    See more | Go to post

    Leave a comment:


  • Hi

    Not sure if this is a great help to you but but it sounded interesting, so the following is one method for abtaining the minutes in a given perion
    Code:
    Option Explicit
    Dim StartTime As Date
    Dim EndTime As Date
    
    Sub AssignTimeToPeriods()
        Dim i As Integer
        Dim ThisPeriodStart As Date
        Dim ThisPeriodEnd As Date
        Dim ThisPeriodTime As Single
        Dim ThisPeriodFieldName
    ...
    See more | Go to post

    Leave a comment:


  • MikeTheBike
    replied to Tracking Record Activities into a table
    Hi

    Not sure what the problem you are having is, but I think this
    Code:
    If Me.NewRecord Then
    11.     CreatedBy = Environ("Username")
    12. End If
    should be in the Form_BeforeUpda te event.

    Does that help?

    MTB
    See more | Go to post

    Leave a comment:


  • Hi

    I think we need to see what you have done to calculate the net profit so we have an idea what the error may be.

    Generally it would be something like
    Code:
    PctNetProfit:([Selling Price]-[Cost])/[Cost]*100
    You should also check that [Cost] is not zero or null before doing the calculation.

    HTH


    MTB
    See more | Go to post

    Leave a comment:


  • Hi

    I would hazard a guess that you need to put this statement
    Code:
    TempVars("UserName").Value = Me.txtUsername.Value
    before DoCmd.Close !!??

    MTB
    See more | Go to post

    Leave a comment:


  • Hi NeoPa

    I am just curious as to why you suggest the Replace() function in stead of just concatenating the variable in the string
    Code:
    strSQL = "Select [ValveName] from tbValve Where [" & MyField & "] Is Null"
    or have I missed something??

    MTB
    See more | Go to post

    Leave a comment:


  • If User is a global variable the code you posed will not work, even with the syntax error corrected.
    I think your code should look like this
    Code:
    DoCmd.OpenForm "frmSchedule", acFormDS, , [User] = '" & User & "' AND wrkDate = #" & Format(DateAdd("d",7,Date),"mm/dd/yyyy") & "#"
    This should return all records for the specified User with a wrkDate...
    See more | Go to post

    Leave a comment:


  • Hi

    First thing I think this
    Code:
    DoCmd.OpenForm "frmSchedule" acFormDS, , [User] = User
    should like this
    Code:
    DoCmd.OpenForm "frmSchedule", acFormDS, , [User] = 'User'
    assuming [User] is a text field.

    To incorporate a date filter you need something like this
    Code:
    DoCmd.OpenForm "frmSchedule", acFormDS, , [User] = 'User' AND wrkDate = #" & Format(DateAdd("d",7,Date),"mm/dd/yyyy")
    ...
    See more | Go to post

    Leave a comment:


  • Hi

    Apart from the syntax error in the MsgBox statement, I currently cannot see why this does not result in the last (Right) sheet name being returned.

    If you get the first sheet name using this, what do get if you use xlApp.Sheets(1) .Name ?


    MTB
    See more | Go to post

    Leave a comment:


  • If anything inside square brackets is not recognised then you will be asked to provide a value manually.

    However this can get confusing if there are other syntax errors. For instance in your early post I have just noticed this
    [PupilOnRoll],*
    has a comma when a period is required.

    If that does not progress it any, then I suggest you (temporarily) simplify the whole thing to and just include the field/tables...
    See more | Go to post

    Leave a comment:


  • AS I said before you do not say which parameter it request, but I think you have missed the space from the table name.
    This
    Code:
    WHERE (Left([MissingUPNs].[Forename],3)=Left([PupilOnRoll].[Forename],3))
    should be this
    Code:
    WHERE (Left([Missing UPNs].[Forename],3)=Left([PupilOnRoll].[Forename],3))
    ??

    It is not considered good practice to have spaces in table or field names!

    MTB
    See more | Go to post

    Leave a comment:


  • Without seeing the full query difficult to be sure, but you may be missing a final closing bracket, ie
    Code:
     WHERE (Left([MissingUPNs].[Forename],3)=Left([PupilOnRoll].[Forename],3))
    ??

    MTB
    See more | Go to post

    Leave a comment:


  • Hi

    You do no say which parameter is requested, but I thing this
    Code:
    Left([PupilOnRoll],3)
    should be like this
    Code:
    Left([PupilOnRoll].[Forename],3)
    ??

    MTB
    See more | Go to post

    Leave a comment:


  • Hi

    Without seeing you query it is a bit difficult to suggest a definitive answer, but I imagine somewhere you will need something like this
    Code:
    WHERE Left(tblOne.Forename,3) = Left(tblTwo.Forename,3) AND tblOne.Surname = tblTwo.Surname AND tblOne.DOB = tblTwo.DOB
    ??

    HTH


    MTB
    See more | Go to post

    Leave a comment:


  • Hi

    Not sure what you are trying to do but perhaps this is what you want.
    Code:
    Private Sub NextDue_BeforeUpdate(Cancel As Integer)
     If Me.NextDue > Me.EndDate Then
         MsgBox "Check Rent Review Date"
         Cancel = True
     ElseIf Me.NextDue < Date Then
         MsgBox "Date in Past"
         Cancel = True
     End If
     
    End Sub
    ???

    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...