Showing posts with label Access. Show all posts
Showing posts with label Access. Show all posts

Friday, April 7, 2017

Access- Insert pictures without embedding in Access Database

To insert a picture in an access form, we can use the control source property of the image control. We pass the field of the form which contains the path of the image file.
STEPS:
  1. Create a table with a field containing the path of image files.
  2. Generate a form based on it.
  3. Insert an image control on this form in design view.
  4. Set the control source property of this image control to the field containing the path of images.
  5. Refresh the form in Form View. 

Wednesday, June 22, 2016

Access- Form Datasheet view

MS-ACCESS VBA: HOW TO FILTER A SUBFORM IN DATASHEET VIEW

Suppose that a text box is placed in the main form and user inputs data into it to get the filtered records from the subform. To achieve this filter, we use the following codes in VBE environment.
The first sub routine in on the Clear Filter Button to remove filter from the subform.
The second sub routine is on the text box used for search and the AfterUpdate event is executed when user submits any value in the text box.

Option Compare Database
Option Explicit

Private Sub cmdClearFilter_Click()
    Me.Text1.Value = ""
    Me.Mobiles_subform.Form.FilterOn = False
End Sub

Private Sub Text1_AfterUpdate()
    Me.Mobiles_subform.Form.Filter = ""
    Me.Mobiles_subform.Form.FilterOn = False
    Me.Mobiles_subform.Form.Filter = "[Brand] Like'*" & Me.Text1.Value & "*'"
    Me.Mobiles_subform.Form.FilterOn = True
End Sub


Remark: Filter is provided a double quoted criteria. In case of string values, we quote the string by single or double quotes. Similarly, date values are placed between # sign. The criteria are basically WHERE clause of SQL.

AFTER FILTER:


Hot Topics