Conditional Combo Box

M

Meesh

One last question for the day! I am trying to create conditional combo boxes
for the first time and I think I have the basics but something in the
execution went wrong. I currently have two columns DeviceID and Portname.
The idea is that when you select the device ID, it will fill the portname
combo with available ports on that device. We do have a table where we are
inputting both device name and portname. DeviceID is importing the deviceID
numbers from the Device table (where we are obviously inputting the devices
and other information about the devices).
Here is the setup:
DeviceID and PortName are both Combo boxes.
DeviceID is bound to a column from the Device table.
Set up a query for portname, it is querying the current table (ports) for
Portname and has the following criteria:
[Forms]![frmTestingAGAIN]![DeviceID]. Somehow altogether to row source looks
like:
SELECT Ports.PortName FROM Ports WHERE
(((Ports.PortName)=[Forms]![frmTestingAGAIN]![DeviceID]));
DeviceID has the following query: SELECT Devices.ID, Devices.DeviceName FROM
Devices ORDER BY Devices.[ID];
DeviceID also has a macro set up on AfterEvent which may or may not be set
up correctly as well. But it has requery selected and under argument is says
Portname.
Back in form view: I select a device id from the list, and then I get a
popup:
Enter Parameter Value
Forms!frmTestingAGAIN!DeviceID
(text box)

Any way to fix this?? I appreciate anyone and everyone’s help.
 
T

TekWarrior

Your underlying query is asking for the 'Text Box' Object named "DeviceID" on
your "frmTestingAGAIN" form.

Is the form "frmTestingAGAIN" open when your running this 'Combo Box'
"lookup"?

Does the the DeviceID field 'Text Box' have the Object name "DeviceID"?
 
M

Meesh

I'm not sure I am understanding what you are asking so please bear with my
ignorance. I can tell you the purpose of what I'm doing. I have a table
that has both deviceID and Portname. The deviceID information is being
pulled from the Device table. The whole idea is that I select the deviceID
and all the ports associated with that device are available for selection in
the combo box for Portname.

This is going to be a big table thanks to switches and all that....

However! I just made a slight change (removed frm from the form name) and I
no longer get the Parameter Value message, but I instead what happens is:

The device IDs are there. But when I select the device ID it is selected
all PORTS with the same "ID" number. (ie.... Device 3 is switch b. But we
also have 3 switches that have a 3 thanks to)(what I'm trying to do is enter
this information so that each switch and port constitutes a primary key, or
something along those lines, a unique row id)

TekWarrior said:
Your underlying query is asking for the 'Text Box' Object named "DeviceID" on
your "frmTestingAGAIN" form.

Is the form "frmTestingAGAIN" open when your running this 'Combo Box'
"lookup"?

Does the the DeviceID field 'Text Box' have the Object name "DeviceID"?


--

Thanks,
Tek


Meesh said:
One last question for the day! I am trying to create conditional combo boxes
for the first time and I think I have the basics but something in the
execution went wrong. I currently have two columns DeviceID and Portname.
The idea is that when you select the device ID, it will fill the portname
combo with available ports on that device. We do have a table where we are
inputting both device name and portname. DeviceID is importing the deviceID
numbers from the Device table (where we are obviously inputting the devices
and other information about the devices).
Here is the setup:
DeviceID and PortName are both Combo boxes.
DeviceID is bound to a column from the Device table.
Set up a query for portname, it is querying the current table (ports) for
Portname and has the following criteria:
[Forms]![frmTestingAGAIN]![DeviceID]. Somehow altogether to row source looks
like:
SELECT Ports.PortName FROM Ports WHERE
(((Ports.PortName)=[Forms]![frmTestingAGAIN]![DeviceID]));
DeviceID has the following query: SELECT Devices.ID, Devices.DeviceName FROM
Devices ORDER BY Devices.[ID];
DeviceID also has a macro set up on AfterEvent which may or may not be set
up correctly as well. But it has requery selected and under argument is says
Portname.
Back in form view: I select a device id from the list, and then I get a
popup:
Enter Parameter Value
Forms!frmTestingAGAIN!DeviceID
(text box)

Any way to fix this?? I appreciate anyone and everyone’s help.
 
T

TekWarrior

The issue I see, which I gleen from the other post I saw of yours too.

Based on the fact you have multiple devices connecting to one another, but
only one of each port number available you have what appears to be a complex
issue, but is actually really simple. Unlike what was pointed out by another
user on the other thread you don’t need three tables (though in their defense
a many to many ratio almost always calls for one, and the fact you have many
ports also is why the third table).

The reason I’m suggesting this way is your experience level in programming
Access, otherwise I would recommend the method the other user was talking
about, but it would take a lot more programming learning curve and for that
you need to read or take classes.

As is this will take some digging in and learning Access VBA a lot more.

I will use limited number for the sake of the example.

Example:
You have available 3 ports on any given device (low number I know), and you
have 100 devices you need to match up where each device only connects to one
other device on a given port (I'm making some assumptions here).

Table: Devices
DeviceID: Autonumber (Primary Key Field)
Device Name: Text Field (Indexed: Yes (No Duplicates)) <- hostname?
UDP Port 1: Text (Default Value: “UDP Port 1â€)
UDP Port 1 Device Connection: Number (Indexed: Yes (No Duplicates)) “Device
Connect Fieldâ€
TCP Port 1: Text (Default Value: “TCP Port 1â€)
TCP Port 1 Device Connection: Number (Indexed: Yes (No Duplicates))
UDP Port 2: Text (Default Value: “UDP Port 2â€)
UDP Port 2 Device Connection: Number (Indexed: Yes (No Duplicates))
You get the idea I hope… all through your TCP and UDP ports you need to track.
(Other Fields)
This table contains all your devices you need to track
100 records

The first part is easy you make a query for each Port field (the device
connect ones) that lookup all the Devices that includes both their Name and
ID. If that device is already used on that port (You should filter out your
current device).

The nature of having the “Device Connect Fields†Indexed: Yes (No
Duplicates), will prevent you from using the same device on the same port for
more then one other device.

Here is where it starts to get even trickier and where I don’t have time to
fully explain it, so crack those books a little to answer some of these
questions so you can get more up to speed and understand the basics first
(you have to walk before you can run).

You need to program it so that after you update the record it updates the
other devices record.

I would do this by creating a temporary over writable table with all the
needed info, again I won’t go into this too deep, but that should put you in
the right direction.

Hope that helps...

--

Thanks,
Tek


Meesh said:
I'm not sure I am understanding what you are asking so please bear with my
ignorance. I can tell you the purpose of what I'm doing. I have a table
that has both deviceID and Portname. The deviceID information is being
pulled from the Device table. The whole idea is that I select the deviceID
and all the ports associated with that device are available for selection in
the combo box for Portname.

This is going to be a big table thanks to switches and all that....

However! I just made a slight change (removed frm from the form name) and I
no longer get the Parameter Value message, but I instead what happens is:

The device IDs are there. But when I select the device ID it is selected
all PORTS with the same "ID" number. (ie.... Device 3 is switch b. But we
also have 3 switches that have a 3 thanks to)(what I'm trying to do is enter
this information so that each switch and port constitutes a primary key, or
something along those lines, a unique row id)

TekWarrior said:
Your underlying query is asking for the 'Text Box' Object named "DeviceID" on
your "frmTestingAGAIN" form.

Is the form "frmTestingAGAIN" open when your running this 'Combo Box'
"lookup"?

Does the the DeviceID field 'Text Box' have the Object name "DeviceID"?


--

Thanks,
Tek


Meesh said:
One last question for the day! I am trying to create conditional combo boxes
for the first time and I think I have the basics but something in the
execution went wrong. I currently have two columns DeviceID and Portname.
The idea is that when you select the device ID, it will fill the portname
combo with available ports on that device. We do have a table where we are
inputting both device name and portname. DeviceID is importing the deviceID
numbers from the Device table (where we are obviously inputting the devices
and other information about the devices).
Here is the setup:
DeviceID and PortName are both Combo boxes.
DeviceID is bound to a column from the Device table.
Set up a query for portname, it is querying the current table (ports) for
Portname and has the following criteria:
[Forms]![frmTestingAGAIN]![DeviceID]. Somehow altogether to row source looks
like:
SELECT Ports.PortName FROM Ports WHERE
(((Ports.PortName)=[Forms]![frmTestingAGAIN]![DeviceID]));
DeviceID has the following query: SELECT Devices.ID, Devices.DeviceName FROM
Devices ORDER BY Devices.[ID];
DeviceID also has a macro set up on AfterEvent which may or may not be set
up correctly as well. But it has requery selected and under argument is says
Portname.
Back in form view: I select a device id from the list, and then I get a
popup:
Enter Parameter Value
Forms!frmTestingAGAIN!DeviceID
(text box)

Any way to fix this?? I appreciate anyone and everyone’s help.
 

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

Top