Solved

MS 2010 Access Forms and Lookups

Posted on 2014-12-10
4
68 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 119

Expert Comment

by:Rey Obrero
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 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

21 Experts available now in Live!

Get 1:1 Help Now