Function Get Filename from File Path

Function: Function GetFilenameFromPath(ByVal strPath As String) As String On Error GoTo errorhandler If Right$(strPath, 1) <> “\” And Len(strPath) > 0 Then GetFilenameFromPath = GetFilenameFromPath(Left$(strPath, Len(strPath) – 1)) + Right$(strPath, 1) End If errorhandler: Exit Function End Function How to Use It: The above function will return a file name with its extension. It returns the rightmost characters of a string up to, but not including the rightmost ‘\’. You can call this function as: Dim myPath as String myPath = “C:\myFolder\MyDoc.doc” call GetFilenameFromPath(myPath) it will return “MyDoc.doc”

Read More

How to Insert Photo into MS Word Bookmark

How to Insert Photo into MS Word Bookmark In this How To, I will demonstrate how to insert a Photo/Picture from a specific file location or from file dialog into a bookmark location of MS Word. Please follow the steps below: Step 1. Create a New Word Document • Open new MS word document file and save as my Photo in the same folder of Access file • Type a description or location of your photo • Move cursor the location where you want to create a bookmark Step 2.…

Read More

How to Reset the Number of AutoNumber field on Table

How to Reset the ID of AutoNumber field on Table Per picture below, a Customer table has a Customer_ID field as a primary key and its data type is set to AutoNumber. That means the Customer_ID is automatically assigned by MS Access to each record and it is incremented by one (1). The first record will start with one on the Customer_ID field. If we delete some records then the next Customer_ID will continue from the one that is deleted. For some reasons that you want to start the Customer_ID…

Read More

Create Save button and a Notification to Save a Change

 How to Create a Save button and a Notification to Save a Change  With the bound fields on form, Microsoft Access will automatically save any changes that we update on fields because the control source of data is linked to the field in table. Whether we close the form or move to a new record it will automatically save the changes. In this How To, I will show you a way of creating a notification to save the changes with a Save button. It gives an option to the users…

Read More

How to Create a Notification to Save a Change

How to Create a Prompt to Save a Change With the bound fields on form, Microsoft Access will automatically save any changes that we update on fields because the control source of data is linked to the field in table. Whether we close the form or move to a new record it will automatically save the changes. In this How To, I will show you a way of creating a notification to save the changes. It gives an option to the users to save or cancel the change. It will make…

Read More

How to Display a Default Text on Combobox

How to Display a Default Text on Combobox Normally, a combobox will be blank when a form is loaded. We will see a list of items when we click on the combo box drop-down list. In this How To, I will demonstrate how to display a default text on the combobox when form is loaded step by step below: Step 1. Add Combo Box Add Combo box Name it as Combo9 We need a combobox of all customers from the Customer table. If you don’t know how to create the…

Read More

How to Transfer Items from Combobox to Listbox

How to Transfer Items from Combobox to Listbox A combobox collects items and displays as a list under the drop-down list. Normally the combobox contains a list of items from table and can be selected once at the time from the drop-down list. However, the items can also be manually added into the combobox. A list box is a collection of items like combobox, but displays as a list one item per line in the rectangle box. In this How To, I will demonstrate how to copy or transfer the…

Read More