473,388 Members | 1,213 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,388 software developers and data experts.

Displaying access records based on selection made in a combo box

I am trying to learn VB after many years programming in Access. I am trying to do something in VB that is simple in Access. How do I display record data on a form based on the selection made in a combo box?

My problem may lie in not understanding which event is triggered when a new value is selected in the combo. I am working on the basis that when the new value is selected, I can then use the new value to reposition the data in the forms data control.

Sorry if this problem may be trivial.

Any help appreciated

Cheers

Kennygee
May 15 '07 #1
2 1615
shidec
26
put code in ComboBox click event like this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo1_Click()
  2.  Data1.RecordSource = "select * from students where class_id='" & Combo1.Text &"'"
  3.  Data1.Refresh 
  4. End Sub
  5.  
May 16 '07 #2
shidec

Many thanks for your help. I am still getting used to the VB events. I had not realised that the event I needed was the Click event. In Access it would be the AfterUpdate event which I think is more descriptive.

All working now

Cheers

Ken
May 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Krzysztof Bartosiewicz | last post by:
Hi! I haven't been using Access for a very long time and I forgot everything :) I will be very greatful for help since I have been fighting with this problem for a few hours... I have three...
2
by: Stephen Poley | last post by:
I have added a combo-box to a form but it frequently fails to display all entries in the table it is based on. There are 43 entries in the table; the control initially displayed only the first 12. ...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
3
by: Col | last post by:
Hi - I'm using Access 2000. I have a combo box with 4 columns based on a query with 4 columns. The query has 111 records. The combo box will only display 11. When I had 3 columns, it displayed all...
6
by: onnodb | last post by:
Hi all, While working on an Access UI to a MySQL database (which should be a reasonable, low-cost, flexible interface to the DB, better than web-based, much less costly than a full-fledged .NET...
0
by: uthooker | last post by:
I have an Access form with some combo boxes in the Form Header that are enabled/disabled using conditional formatting based on the setting in a checkbox also in the Header (Combo box = Enabled by...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
0
by: solargovind | last post by:
Hello, I have few problem with Dlookup condition. I need to retrieve next record or previous record based on certain condition. The conditions are set in in the combo box. Here, I am trying to...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.