Looking for Sample DataBase

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

Hi Everyone
I am beginner with some intermediate skills and want to create a DB
where I can put information about a company and then on another form I
have ten drop down list that refers back to the information I collected
about the company to create a list of companies from my selection.
Example.
*Sample inputs*
Company: 123
Inventory: Wood
Stores: 10

Company: xyz
Inventory: Metal
Stores: 15


*Sort screen*
Inventory drop down list: where I can select either wood or metal
Stores drop down list: where I can select 10 or 15

Then on the screen have a subform or report listing the result.

Any ideas or samples for me to see?

Marco
www.classactinsurance.com
 
Hi Marco,

Access comes with a demo database called NorthWind.mdb. It has lots of code
samples. The help functions in Access refer to this demo database as well.
I'd suggest starting there, then if you need more help, check back with the
newsgroup.

Darhl
 
I don't see anything in there that I can use. I found a db created by
an MVP called demofilterA2k. I created a unbound combo box that works
with textfield2. I am not sure what to place in the event procedure to
use both field to perform the filter.

Form_frmDemoFilter.Form.Filter = "TextField3='" & Me.cboChooseColor &
"'"
Form_frmDemoFilter.Form.Filter = "TextField2='" & Me.Combo9 & "'"
Form_frmDemoFilter.Form.FilterOn = True

I added the 2 line item from the orginal.

Any advise?
 
Marco:

One way to do this is to base a form or report on a query which references
the combo boxes on your form as parameters. To make the selection from a
combo box optional you test for it being Null. So with your simple example
you'd have combo boxes cboInventory and cboStores on your form, which we'll
call frmCompanyDlg for this example, each combo box listing all possible
Inventory and Stores values. The query would then be along these lines:

SELECT *
FROM Companies
WHERE
(Inventory = Forms!frmCompanyDlg.cboInventory
OR Forms!frmCompanyDlg.cboInventory IS NULL)
AND
(Stores = Forms!frmCompanyDlg.cboStores
OR Forms!frmCompanyDlg.cboStores IS NULL);

You'd just extend this in the same way for all 10 of the combo boxes on your
form. Use the query as the RecordSource of a form or report and on the form
have a button to open the form or report with something like one of these in
its Click event procedure:

DoCmd.OpenForm "frmCompnies"

or

DoCmd.OpenReport "rptCompanies",acViewPreview

Alternatively you could include a subform based on the query in the same
form and in the button's Click event procedure requery it with:

Me.YourSubfromControl.Requery

Note that YourSubfromControl is the name of the subform control on the main
(parent) form, i.e. the control which houses the subform, not the name of its
underlying form object.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top