Using a qualifier to populate a form (or table?)

twolfe13

New Member
Joined
Nov 3, 2011
Messages
5
I have a table with several fans. Each fan has one of a few different types (ex. axial, centrifigual, etc). Another table contains the geometry of the fan (ex. diameter, blade details, etc). I want to create a form to allow the user to input this geometric information for each fan. However, I want the form to change based on what type of fan they are entering data about.

For example, if they are entering data about a centrifugal fan, the form would contain only the geometric parameters relavant to a centrifugal fan. It would NOT include options to enter information that is uniquely axial.

I'm rather new to access, so my initial thought is to make a table of all geometries and make the entry of each geometry a fan type and run queries based on what fan type you want. However, the problem is slightly more complex than each parameter being axial or centrifugal. Some parameters can be both or a specific type of centrifugal. So for example:

Geometry A: axial
Geometry B: centrifugal
Geometry C: axial & centrifugal
Geometry D: centrifugal & special type of centrifugal

So in that case I would need several entries for a single geometry. I'm thinking that there is a simpler solution that making several identical fields.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Don't try to have different field copies for each geometry. As you said, that's a bad idea.
You need one field that holds the geometry type for that record, which then drives all the others (or their visibility).
Use the Tag property of the controls. For each control that needs to display for A, put an A in the tag; if it needs to display for more than one geometry put (say) A, C in the tag.
Note; if you are using Geometry A as your identifier, put that in the tag instaed of just A.
In the AfterUpdate event of your Geometry field, put code like this:
Code:
Dim ctl As Access.Control
For Each ctl in Me.Detail.Controls
  If Instr(1,ctl.Tag,Me.Geometry.Value)>0 Then
     ctl.Visible = True
  Else
     ctl.Visible = False
  End If
Next ctl

Denis
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top