MS Access 2007 Runtime Form Views

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.
Mike_SchnobrichAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
Mike_SchnobrichAuthor Commented:
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
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike_SchnobrichAuthor Commented:
Thank you, that worked like a charm!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.