473,386 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

combobox trouble

I have a form with data from a box (Table box), on his form is a
subform with the instuments that are in this box. The instruments
(Table instruments) are categorized by category (Table Category). This
is done because there are a verry much different instruments to choose
from. Now I want to choose a category so that the active record in the
subtable (combobox) shows only the instruments that belong to the
selected category. This works fine, but all my other records in the
subtable (instrument_in_net) are responding to the new category as
well (all the current values disappear when I move the mouse over it,
while the actual data remains unchanged). Is there a way to avoid
this?? So that ONLY the record that has the focus, reacts to the
change of the category?
Some more relevant information:

Table Instrumenten:
INSID
CATID (linked to tbale category)
Instrumentnaam

Subtable instrument_in_net
BOXID (linked to table box)
INSID (linked to tblinstuments)
Amount

Table Category
CATID
Categoryname

On the form (inhoud_van_net), the category (voorlopigcategorie) is a
non-stored value. I use it only to build a query. When I cange the
category, the program changes the query according to the selection:
(Public is a public declared value)

Private Sub voorlopigcategorie_Change()
If voorlopigcategorie.Text = "-" Then
'show all instruments
PublicSql = "SELECT Instrumenten.Categorie,
Instrumenten.Instrumentnaam FROM Instrumenten;"
Else
'show only instruments from choosen category
PublicSql = "SELECT instrumenten.Instrumentnaam,
instrumenten.Categorie FROM instrumenten WHERE
(((instrumenten.Categorie)=[Forms]![Inhoud_van_net]![voorlopigcategorie].[value]));"
End If
End Sub

Nov 12 '05 #1
1 1517
A.J.M. van Rijthoven wrote:
I have a form with data from a box (Table box), on his form is a
subform with the instuments that are in this box. The instruments
(Table instruments) are categorized by category (Table Category). This
is done because there are a verry much different instruments to choose
from. Now I want to choose a category so that the active record in the
subtable (combobox) shows only the instruments that belong to the
selected category. This works fine, but all my other records in the
subtable (instrument_in_net) are responding to the new category as
well (all the current values disappear when I move the mouse over it,
while the actual data remains unchanged). Is there a way to avoid
this?? So that ONLY the record that has the focus, reacts to the
change of the category?
Some more relevant information:

Table Instrumenten:
INSID
CATID (linked to tbale category)
Instrumentnaam

Subtable instrument_in_net
BOXID (linked to table box)
INSID (linked to tblinstuments)
Amount

Table Category
CATID
Categoryname

On the form (inhoud_van_net), the category (voorlopigcategorie) is a
non-stored value. I use it only to build a query. When I cange the
category, the program changes the query according to the selection:
(Public is a public declared value)

Private Sub voorlopigcategorie_Change()
If voorlopigcategorie.Text = "-" Then
'show all instruments
PublicSql = "SELECT Instrumenten.Categorie,
Instrumenten.Instrumentnaam FROM Instrumenten;"
Else
'show only instruments from choosen category
PublicSql = "SELECT instrumenten.Instrumentnaam,
instrumenten.Categorie FROM instrumenten WHERE
(((instrumenten.Categorie)=[Forms]![Inhoud_van_net]![voorlopigcategorie].[value]));"
End If
End Sub

I am not sure if what you are describing is associated with a continous
form or something else.

Why not use a filter instead? Lets call the mainform MF and subform SF,
the combo ComboCat.

Sub ComboCat_AfterUpdate
Dim strFilter As String
If ComboCat <> "-" Then
strFilter = "Categorie = " & Me.ComboCat
endif
Forms!MF!SF.Form.Filter = strFilter 'empty if ALL
Forms!MF!SF.Form.FilterOn = (strFilter > "") 'True if not ALL
End Sub

This will filter the records based on the category selected in the main
form.


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oren Kaplan | last post by:
Hello, I posted a msg on the Access-related groups in hope someone there could help me but since almost two days have past and I didnt get a response (Im a bit hard pressed with the problem) I...
8
by: Supa Hoopsa | last post by:
I have a databound combobox within a datagrid. I have set the DisplayMember and ValueMember. BUT, how do I capture the Value (SelectedValue) when the user changes the selection?
1
by: A.J.M. van Rijthoven | last post by:
I have a form with data from a box (Table box), on his form is a subform with the instuments that are in this box. The instruments (Table instruments) are categorized by category (Table Category)....
1
by: Seth Delaney | last post by:
I have a form with a combobox and a list box. The combobox will list records (names of queries) that are entered in a table called tblListName. I have the combobox set to get its values from this...
3
by: Flack | last post by:
Hello, I am beginning to write a custom combobox control. Right now it doesn't do anything special. I created a class that extends ComboBox: public class TimeSelector :...
3
by: RSH | last post by:
I am slowly getting the hang of objects and creating my own. I was given some help in assigning an object to a ComboBox collection. I have been looking at it and I get the concept which is very...
4
by: Vish | last post by:
Hi, I need to make the text on a combobox that is disabled to be drawn with a black color. I was not able to find any help on this online. The drawItem seems to apply only for the dropdpwn...
14
by: Chris | last post by:
I have a need to have a combo box that just has Yes & No as it options. This will be used everywhere in the application, so I thought I would make a control that inherits from combobox. I am...
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
0
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.