Solved

MS Access 2007 Runtime Form Views

Posted on 2009-07-02
4
550 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now