Search results

  1. Ranman256

    Count blank fields from a LEFT JOIN query

    =DCount("*", "qsMyQuery", "[HRMS] is null")
  2. Ranman256

    Autopopulate years and make previous years grey meaning you will not use

    when user changes record, change the color Const kGRAY = 15132391 sub Form_Current if txtYear = Year(date()) then txtYear.forecolor = vbBlack else txtYear.forecolor =kGRAY endif end sub
  3. Ranman256

    Solved Subform not showing some information

    do you have the subform properties bound: LINK MASTER ID =txtID LINK CHILD ID =txtID to the master form ID field? or the subform query can have the ID as criteria: select * from tChildTbl where [id] = forms!fMasterFrm!txtID
  4. Ranman256

    Solved Set frm = Forms(FormName): Error 438

    i use this method all the time dim frm as form dim sFormName as string sFormName= "fMyForm" docmd.openform sFormName set frm = forms(sFormName) now,' fMyForm' MUST be open already. You cannot set it if its closed.
  5. Ranman256

    Solved "Operation must use an updateable query" but only sometimes

    1 big rule: you cannot run an update query if the TOTALs is on. (summation sign) nor any of the subqueries in the update that uses Totals.
  6. Ranman256

    Extract correct leave time

    which leave time IS the correct leave time?
  7. Ranman256

    Hyperlink subaddress

    This code has many uses. Paste this code into a module, Store the path in the field, and it will open ANY file in its native application. if the item in the text box is a URL, it will open in default explorer if .docx file, it will open the document in word if .xlsx file, it will open the...
  8. Ranman256

    Active X error 429

    i've used GetApplication() sometimes to catch it if already open: Set mobjAcroApp = GetApplication("AcroExch.App") 'it may be open already so use this 'not: Set mobjAcroApp = CreateObject("AcroExch.App") Function GetApplication(className As String) As Object ' function to encapsulate...
  9. Ranman256

    Solved Display date on the report

    in a form, fDateRng, put in a unbound field: txtDate the query for the report uses it as criteria: where ((admissiondate<=forms!fDateRng!txtDate AND dischargedate>forms!fDateRng!txtDate) OR (dischargedate is null)). add to the query as its own field: RunDate: forms!fDateRng!txtDate then add...
  10. Ranman256

    the table is already opened exclusively by another user

    usu a form (or forms) will both have the table open more than once.
  11. Ranman256

    Catching ODBC connection failure error.

    i cycle thru a list of tables to get their record count. if any error out, then its a broken connection. on error goto errTbl while not rst.eof vTbl = .fields("TblName").value iCt = 0 iCt = Dcount("*",vTbl) if iCt = 0 then msgbox "Err " & vTbl wend exit sub ErrTbl: msgbox "Err...
  12. Ranman256

    How to hide a label on 2nd subreport if 1st subreport has no data

    on rpt2 load event, have it check the query count in rpt1 Private Sub Report_Load() lblRpt2.visible = Dcount("*","qsRpt1Query")>0 End Sub
  13. Ranman256

    Resize Form to Original Size

    dont use Maximize. remove any maximize commands. just open the form : docmd.OpenForm "fMyform",acNormal ,,,,acWindowNormal and it should open in its normal size. (as long as youre not using TABBED forms)
  14. Ranman256

    Application Error: Undefined Function 'Right' in Expression

    This is a false error. I get it too when a reference is wrong. (Access is confused w that reference) If a known function gives an error, this is the problem. The reference is not missing but something is wrong with it. Sometimes removing it, then adding it back with the correct path helps. If...
  15. Ranman256

    #ERROR

    I made a function similar to NZ, called NZB() Null to Blank USAGE: = NZB([Enquirymaster100 subform].[Form]![REF NO]) Public Function NZB(ByVal pvVal) On Error Resume Next Select Case True Case IsNull(pvVal) NzB = NZ(pvVal, "") Case Else NzB = pvVal End Select End Function
  16. Ranman256

    Import data from file

    copy the file every time to the same file name, ie: c:\temp\File2Import.csv link the csv file as external table. (using Import Spec. save import spec) create a query to import the data. put query in a macro. then the procedure is: 1. overwrite the new file to: c:\temp\File2Import.csv 2. run...
  17. Ranman256

    Which modules are needed

    no need to do it at all. It would only break something. Leave them. Text does not take up room. Internal Tables take up room. compact regularly.
  18. Ranman256

    Create Access table from Excel spreadsheet

    import the spreadsheet it will create the table.
  19. Ranman256

    Help with combo box and years

    never hard values on combos. either pull year value from the table that hold your data sets or make a dedicated table, tYears, and enter the year value there so the combo can use it.
  20. Ranman256

    How to sum date/time field

    calculate the elapsed time in integer minutes (not time format). Then just sum the minutes.
Back
Top Bottom