Posts

Showing posts from October, 2019

filter a report based on a form value

The easiest way I have found accomplishing this without updating the query is to assign a small piece of code to a a button named cmd_view_all_shares: DoCmd.OpenReport "the_report_you_want_to_open", acViewPreview, , "the_field_you_want_to_filter_in_the_report = " & the_field_in_the_form In practice, the code looks like this: Private Sub cmd_view_all_shares_Click() 'Filter report to display only Supplier currently showing on frmExample ' (by SupplierID field) DoCmd.OpenReport "rpt_Employee_Summary", acViewPreview, , "EmployeeID = " & EmployeeID End Sub Today, I needed to open a record specific report from a command button on a form.  Rather than building a filter query to serve as the data source for my report, I decided that I would implement a small piece of code to filter the report that opens up. This code utilizes the DoCmd.OpenReport function and filters the report it opens based on the field “Employee N

Format a date and time field

Image
https://support.office.com/en-us/article/format-a-date-and-time-field-47fbbdc1-52fa-416a-b8d5-ba24d881b698 Access automatically displays the date and time in the General Date and Long Time formats. The dates appear as, mm/dd/yyyy in the U.S. and as, dd/mm/yyyy outside the U.S. where mm is the month, dd is the day, and yyyy is the year. The time is displayed as, hh:mm:ss AM/PM, where hh is the hour, mm is minutes, and ss is seconds. These automatic formats for dates and times vary depending on the geographic location specified in the  Microsoft Windows Regional and Language Options setting  on your computer. For example, in Europe and many parts of Asia, depending on your location, you might see the date and time as 28.11.2018 12:07:12 PM or 28/11/2018 12:07:12 PM. In the United States, you would see 11/28/2018 12:07:12 PM. It is possible to change these predefined formats by using custom display formats. For example, you can enter a date in a European format such as 28.11.2018,

How to Show AM / PM Symbols in System Tray Clock in Windows 7 and Later

Image
https://www.askvg.com/how-to-show-am-pm-symbols-in-system-tray-clock-in-windows-7/ Windows 7 and later don't show  AM/PM  symbols in system tray clock. Also Windows shows the time in 24 hour format i.e. 18:03. If you want to get back the AM / PM symbols, then this tutorial will help you. 1.  Type  intl.cpl  in RUN or start menu search box and press Enter. It'll open  Regional and Language Options  window. 2.  Now click on " Addition Settings " button. 3.  Go to " Time " tab and you'll see the value of " Long time " will be set to  HH:mm:ss . Just add  tt  at last of the value, i.e. change the value to  HH:mm:ss tt 4.  If you want to show the time in  12 hour format  (06:30 instead of 18:30), then change the value to  hh:mm:ss tt 5.  That's it. Click on  Apply  button and you'll get the AM / PM symbols back in system tray clock.

How to Reset Full Menu Option For Database On Startup

So you can't actually get to the Startup screen at all atm? Not good. There are some tricks to try but it is possible to leave a database completely  protected  if you're not careful and never be able to access it again. Try holding down the bypass (Shift) key while opening the database. Try using Ctrl-Break while the system is running to see if it will allow the operator into the Debug window. Whenever  protecting  a database like this  always  leave yourself a back-door. I know this is a bolted horse scenario but it won't hurt to make the point anyway. Let me know how you get on

How to disable the home menu in access 2007

Method #1 Click the Office button in the top right corner, then in the bottom right corner of the drop down menu should be an "Access Options" button. Click this to bring up the properties. Select the Current Database tab, scroll down to Ribbon and Toolbar Options and untick Allow Full Menus and Allow Default Shortcut Menus. Method #2 Click the Office button in the top left corner, then in the bottom right corner of the drop down menu should be an "Access Options" button. Click this to bring up the properties. Select the Current Database tab, scroll down to Ribbon and Toolbar Options and untick Allow Full Menus and Allow Default Shortcut Menus. You might also want to consider hiding the Document Tabs and disabling the Access Special Keys (in the Application Options area of Current Database). Hope that helps --------------------------------------------------------------------------------------------------------------------------------------- How to R

How to Hide Navigation Pane, Full Menu, and Shortcut Menu

Image
How to Hide Navigation Pane, Full Menu, and Shortcut Menu How to Hide Navigation Pane, Full Menu, and Shortcut Menu The main purpose of hiding the Navigation Pane, Full Menu, and Shortcut Menu is to prevent users to see the table list, queries, forms, reports, and modules. It also appears to be professional looking. The Access file will display the Navigation Pane after open as shown on the Figure 1. After hiding, there is no full menu and no Navigation Pane when Access file is opened (see Figure 2). Figure 1 Figure 2 Step by Step of Hiding Navigation Pane, Full Menu, and Shortcut Menu Step #1  Click a  Customize Quick Access Toolbar  from top of left hand toolbar. Then select  More Commands…  from the list to open an  Access Options  window. Step #2  Select  Current Database section  then uncheck box for  Display Navigation Pane, Allow Full Menus, and Allow Default Shortcut Menus . You can also uncheck box for Use Access Special Keys if you want to d

Microsoft Access 2016 Add Custom Currency Signs and Symbols

Image
$ #,##0.00

Export Access Object to Excel ,PDF, RTF , etc. using DoCmd.OutputTo

Microsoft Access allows us to export access object like table, query ,etc to other formats like Excel, PDF, RTF , etc. Using “DoCmd.OutputTo” To know about DoCmd.OutputTo visit the below link http://msdn.microsoft.com/en-us/library/aa141534(v=office.10).aspx Syntax DoCmd.outputto ObjectType, ObjectName, OutputFormat, Output file, Autostart, Templatefile, encoding, ObjectType – acOutputTable( to output table), acOutputquery(to output query),acoutputreport(to output report),ascendform(to output form), acOutputModule(to output module) ObjectName – Name of table, query, Report etc. OutputFormat – acFormatHTML ,acFormatRTF ,acFormatSNP,acFormatTXT ,acFormatXLS, acFormatXLSX , acFormatPDF , etc. Output file – Complete path of output file eg. C:\ abc.xls  or d:\ abc.pdf  Keep it blank if you want to save at run time. AutoStart Optional Variant Templatefile – The full name, including the path, of the file to use as a template for an HTML file Encoding- Optional Variant  If you are fa

DoCmd.OutputTo in xlsx (Excel 2007+) Format

https://www.devhut.net/2014/08/07/docmd-outputto-in-xlsx-excel-2007-format/ A common technique for exporting data to Excel is to utilize the   DoCmd.OutputTo  Method. Now, previously (pre Office 2007), the basic format to export a query to Excel format was simply: DoCmd.OutputTo acOutputQuery, "YourQueryName" , acFormatXLS, , True BUT, once you port such a database to a post Office 2007 computer, you start to get it exported as a “ Microsoft Excel 5.0/95 Workbook (*.xls) ” format and such a file will thus open Excel in compatibility mode possibly given the user compatibility errors/messages when they go to save the file after working with it. So unless you have to ensure legacy compatibility, it is strongly advisable to update your code to export the data in “ Excel Workbook (*.xlsx) ” format, the new Excel file format thus eliminating any compatibility issues. Hence, we simply need to change the  OutputFormat  format variable to a more appropriate format ( a

MS Access Tutorial

https://codedocu.com/Office-365/Access/ Access vba Code Examples sevGrid Queries Basics Naming Forms Tables vba Code Recordset Fehler Errors Controls web Browser Listcontrol Option Box Combo Box Basic Controls Image Control Access-Excel Emails Ribbonbar Excel Code vba Makro Formulas Templates Emails Mail Merge Calculations Pivot Chart VSTO Addin Errors Code Examples Powerquery Tutorials Add-in Office Office develop COM Controls OneDrive Cloud Programming setup cloud Other Software Outlook Visio Word vba Errors Tutorials

MS Access: export a query to Excel with Docmd.Output

Image
https://codedocu.com/Details?d=2136&a=8&f=319&l=0 Download: Datei 1:  Access_Export_Query.accdb Datei 2:  Output_Results.xlsx The example shows how to export an Access query to Excel. The query contains current data from a table, which was filtered by a radio button. For this you use the command Docmd.OutputTo in Microsoft Access As DoCmd.OutputTo acOutputQuery,  "qryCars_Sale" , acFormatXLSX, ,  True When executing the OutputTo command, a Save dialog box is automatically displayed which would like to save a document in Excel. DoCmd.OutputTo acOutputQuery,  "qryCars_Sale" , acFormatXLSX, ,  True The acOutputQuery parameter indicates that a query is in the third parameter. The query query is bound to the form that is currently open and uses a radio button. If you want to output the output directly into a named Excel file, then you have to name the Excel file name with the foll path Dim  sFilenam