Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access 2007 Runtime Form Views

Posted on 2009-07-02
4
Medium Priority
?
605 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

721 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