473,396 Members | 2,099 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.

Basing one combo box on another example for Microsoft problems

Basing one combo box on another
January 31, 2005
By Sal Ricciardi

Making choices is what a combo box is for, but sometimes one choice depends on another. In this installment, you'll learn how to set up one combo box so that its list is based on the selection you make in another. We provide an example in a sample database that you can download.

When I add the close statement to his code it keeps asking for the combo box parameters.


Private Sub Category_AfterUpdate()
Me.Product = Null
Me.Product.Requery
Me.Product = Me.Product.ItemData(0)
End Sub

Private Sub Form_Current()
Me.Product.Requery
End Sub

Private Sub Form_Load()
If IsNull(Category) Then
Me.Category = Me.Category.ItemData(0)
Call Category_AfterUpdate
End If
End Sub

Private Sub Product_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Student ID] = " & Str(Nz(Me![Product], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub

Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click

DoCmd.Close

Exit_cmdClose_Click:
Exit Sub

Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click

End Sub
Nov 8 '06 #1
0 1531

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

Similar topics

3
by: Steve | last post by:
C# I have some combo boxes, full of lookup descriptions. When I retrieve a dataset for my record, the values that need binding to the combos are the actual record IDs that relate to these...
1
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
2
by: J. Yuan | last post by:
Hi, I am having some problems getting combo boxes to work right. I'm trying to get a combo box to select all the distinct "invoice numbers" in a table by using the following SQL statement:...
7
by: Hans Merkl | last post by:
Hi, Can anybody recommend a combo box control (textfield + dropdown list) for ASP.NET? I have looked at some products and it seems they all have some problems. I haven't yet found a combo box...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
1
by: Louly | last post by:
Hi everybody, In a form I have 2 combo boxes, X's Row Source Type is a "Filed list" and Y is based on a "Query". I wan to base X's drop down list on what's selected from Y's list. Can anyone...
2
by: docsix | last post by:
I am having trouble basing a combo box in a subform that gives selected data from the mainform combo box. Basically combo box1 gives a restricted data set to combo box2. Here is an small sample of...
2
by: computerider | last post by:
I have used the example posted here from the Microsoft website: (http://office.microsoft.com/en-us/access/HA011730581033.aspx) but my question is if need to use this logic to drill down to a...
2
by: accesslearner | last post by:
Hi! I' m learning access, and now I have a problem. I have a form with two combo boxes, so that one is related on another. I found cases and I know how to do this, but I didn't found the code how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.