Solved

MS Access 2007 Runtime Form Views

Posted on 2009-07-02
4
569 Views
Last Modified: 2013-11-28
I know that the Access 2007 Runtime disables the Design View, but does it also disable the Layout View.  In the Layout View, different filters can be done on the columns. I would like to do the filtering that way if possible.
0
Comment
Question by:Mike_Schnobrich
  • 2
  • 2
4 Comments
 
LVL 84
ID: 24769244
Layout view is just a different version of Design view, and all Design options are disabled when using the Runtime so no, you cannot use the Layout view in the Runtime.

I'm not aware of any "different filters" ... can you explain that further?
0
 

Author Comment

by:Mike_Schnobrich
ID: 24769374
The problem I have is there are several columns that are informational only during data entry but are used to filter records at one point or another during data entry. In the runtime, I can filter and sort on the enabled columns but not the others. I guess the layout view allows for all columns to be sorted and filtered.

Since I have to have some sort criteria on the data enter form, what do you think is the best aproach, a macro like Requey or a VBA subroutine  where can I find some examples? The form is based on a query.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 24772105
The Layout view is intended to give you a visual of what your form/report will look like based on different filtering selections, object layouts etc etc ...

So your goal is to have a Form that can be filtered? You can build a small Filter form where your user would select the column they wish to filter, and then enter/select the value to be applied to that column. At that point, you can then use VBA to apply the Filter to your form ...

This can also be done in the Form's Header or Footer section. Depends on what "look and feel" you're looking for in your app.

As to examples:

Assume you have a form with a combo (cboColumn) and a Textbox (txtValue) and a button (cmdFilter). Your goal is to filter a form named "frmCustomers".

Your combo is set to use a Value List, and has this as the RowSource:

First Name, Last Name, Zip Code

Your cmdFilter Click event would look like this:

Dim sColumn As String

If Nz(Me.cboColumn, "") = "" Or Nz(Me.txtValue, "") = "" Then
  Msgbox "You must select a Column and enter a Value"
  Exit Sub
End If
'/have to get the acutal column name we want to filter;
'/the combo is showing "friendly" names - we need the
'/actual name in the column
Select Case Me.cboColumn
  Case "First Name"
    sColumn = "sFirstName"
  Case "Last Name"
    sColumn = "sLastName"
  Case "Zip Code"
    sColumn = "sZip"
End Select

Forms("frmCustomers").Filter = sColumn & "='" & Me.txtValue & "'"
Forms("frmCustomers").FilterOn = True

This is a simple example; you can also allow multiple column selections, and you'll likely need to handle both Text and Numeric values. I'm working on a sample db that will show how to do this.

0
 

Author Closing Comment

by:Mike_Schnobrich
ID: 31599419
Thank you, that worked like a charm!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question