473,396 Members | 1,767 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,396 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 1518
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.