Solved

MS 2010 Access Forms and Lookups

Posted on 2014-12-10
4
73 Views
Last Modified: 2015-03-24
I am trying to create an Access Form to replace the Excel Workbook we currently use.

The Excel Workbook had a series of VLookup functions and drop downs to keep the entries accurate and consistent.

I am looking for help on how to do this in Access 2010.

Example 1) In the Form, an employee will select the type of new business he/she wrote and the proper bonus amount will then be displayed automatically. The bonus amount is dependent on the type of new business.

Example 2) An employee will select the company and then the line of the new business, enter the premium amount, and then the correct commission rate will be selected to display the earned revenue. The rate is dependent on the line. The line is dependent on the company.

Thank you for your help.
0
Comment
Question by:Newbi22
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40492388
the general idea is
you have to import/create the Lookup values from excel to access tables and use the table as the rowsource of your drop down boxes.

from here you can do your coding to filter cascading combo boxes.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 40492847
Then this really needs to be two separate questions...
...as what you are asking is not a "simple" question and requires a good grasp of database design.
Hear is a sample db for your first concern.
-Create a query to pull in fields from all 3 tables
-Create a form from this table
-Create comboboxes to select the employee and business

Note that you will have to research "many to many" tables, in order to determine how to set up your keys for your specific situation.
Database60.mdb
0
 
LVL 33

Expert Comment

by:Mike Eghtebas
ID: 40493142
Select Busines_type,  bonus_amount, company, premium_amount, commission_rate, earned_revenue From...

You will have above data in a query. Most likely coming from several tables:

To handle missing data do:

Select Nz(Busines_type,"") As BType,  Nz(bonus_amount,0) As BAmount, Nz(company,"") As Co, Nz(premium_amount,0) As Perm, Nz(commission_rate,0) As CommRate, nz(earned_revenue,0) As Revenue From...

Here we have 6 criterias (Busines_type,  bonus_amount, company, premium_amount, commission_rate, earned_revenue)

Build 6 text boxes for each. The following code will filter if you put some data in several and ignore the rest. What you ignore, the query will ignore it too.

As criteria in the above query (you may call it qSearch) supply criteria like:

IIF(fnBusines_type()="<all>", [Busines_type], fnBusines_type())

In a module have one function call for each criteria like

Function fnBusines_type()As Variant ' this could change to string or double to match your need.
On Error GoTO 10
Dim varVal as variant
varVal = Nz(Form!Morm1!txtBusines_type, "<all>")  'put break point to make sure the value is read correctly. 
fnBusines_type=varVal 
Exit Function
10:
fnBusines_type="<all>"
End Function

Open in new window


* please try for Busines_type only. After you make it work add another one, for example Company.
0
 

Author Closing Comment

by:Newbi22
ID: 40684808
thank you.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

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