473,403 Members | 2,183 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,403 software developers and data experts.

A combo box inquiry

Hi everybody,

I have "cmb A" and "cmb B", "cmb A" lists tables names and "cmb B"
should list the fields of the table name selected in "cmb A". I've
tried to implement it but I it doesn't work! Any help would be
appreciated.

Thanks for your time.

Lou

Nov 1 '06 #1
7 1608
find the answer here:
http://www.mvps.org/access/forms/frm0028.htm

Nov 1 '06 #2

luanhoxung wrote:
find the answer here:
http://www.mvps.org/access/forms/frm0028.htm
Thanks for your quick reply.

I've tried it but it didn't work also. I think the problem is that the
system doesn't understand that what's selected in the "cmb A" is a
table and what we need for "cmb B" is the list of fields in this table.
I still need help with this.

Nov 1 '06 #3
Louly wrote:
luanhoxung wrote:
find the answer here:
http://www.mvps.org/access/forms/frm0028.htm

Thanks for your quick reply.

I've tried it but it didn't work also. I think the problem is that the
system doesn't understand that what's selected in the "cmb A" is a
table and what we need for "cmb B" is the list of fields in this table.
I still need help with this.
Perhaps ADO can help here.

This more or less air code works for me:

Private Sub Combo0_AfterUpdate()
With Combo1
.Value = ""
.RowSource = Combo0.Value
End With
End Sub

Private Sub Form_Open(Cancel As Integer)
Dim f As ADODB.Field
Dim r As ADODB.Recordset
Set r = CurrentProject.Connection.OpenSchema(adSchemaTable s)
Set f = r.Fields("TABLE_NAME")
Combo1.RowSourceType = "Field List"
With Combo0
.RowSourceType = "Value List"
While Not r.EOF
.RowSource = .RowSource & f.Value & ","
r.MoveNext
Wend
End With
End Sub

Combo0 is tables, Combo1 is fields. Their rowsource in the property
sheet is left blank for both.

Requieres Access>= 2000.

Nov 1 '06 #4
Forgive my ignorance. Here's what I did to solve this problem, and I
want somebody to explain to me why it didn't work:

First of all I created a table with the list of tables that are to be
used and called it with a query from "Cmb A". Second in "Cmb B",
RowSourceType = Field List, and RowSource cmbA.column(1).

Thanks for your time.

Lou

Nov 2 '06 #5
Louly wrote:
Forgive my ignorance. Here's what I did to solve this problem, and I
want somebody to explain to me why it didn't work:

First of all I created a table with the list of tables that are to be
used and called it with a query from "Cmb A". Second in "Cmb B",
RowSourceType = Field List, and RowSource cmbA.column(1).
1. Some event has to tell Cmb B to update/refresh its list; it seems
you did not provide for this;
2. Access Forms are involved; Access forms are complex and sometimes
their workings are arcane; I find it sufficiently challenging to keep
up with the myriad peculiarities of things that do work; probably you
have not phrased the Row Source property in a manner that Access
understands; TTBOMK this can be:
a literal list;
a table name;
a query name;
a UDF, prefaced by "="
a BIF, prefeaced by "=";
it could be something as simple the column index you are using.

You have been given a working solution. If you insist on doing the
thing your way, then
Good Luck.

Nov 2 '06 #6

Lyle, thank you so much for your patience.

I copied and customized your solution and I pasted it here:

Private Sub Alarm_Job_AfterUpdate()
With Alarm_Count_Date
.Value = ""
.RowSource = Alarm_Job.Value
End With
End Sub
Private Sub Form_Open(Cancel As Integer)
Dim f As ADODB.Field
Dim r As ADODB.Recordset
Set r = CurrentProject.Connection.OpenSchema(adSchemaTable s)

Set f = r.Fields("TabNames")
Alarm_Count_Date.RowSourceType = "Field List"
With Alarm_Job
.RowSourceType = "Value List" 'I think this should be
"Table/Query" because
'it lists
the tables names from the
'table
called "TabNames"
While Not r.EOF
.RowSource = .RowSource & f.Value & ","
r.MoveNext
Wend
End With
End Sub

*Alarm_Job --Combo0 --Table cmb
*Alarm_Count_Date --Combo1 --Field cmb

Again thank you so much.
And sorry if I ask too much!
Lou

Nov 2 '06 #7
"Louly" <mi*****@gmail.comwrote in
news:11**********************@m73g2000cwd.googlegr oups.com:
Forgive my ignorance. Here's what I did to solve this
problem, and I want somebody to explain to me why it didn't
work:

First of all I created a table with the list of tables that
are to be used and called it with a query from "Cmb A".
Second in "Cmb B", RowSourceType = Field List, and RowSource
cmbA.column(1).

Thanks for your time.

Lou
You need to requery the "cmb B" rowsource in the "Cmb A"AfterUpdate
event.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 2 '06 #8

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

Similar topics

11
by: Berislav Lopac | last post by:
Imagine three options: a) There is an XML file. A PHP5 script loads it and puts it into a DOM document object. Then, given an input string, a function looks via XPath for a node with that name...
3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
4
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
2
by: Jeff Mason | last post by:
I'm observing some strange behavior when I use a bound combo box in conjunction with the combo's anchor property. I define a form which contains just a textbox and a combo box. The text box is...
4
by: segue | last post by:
Just Curious.
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
2
by: kiranmn75 | last post by:
I want to dynamically populate a combo box through javascript. Data is coming from a array. Sometimes data list may contain items in excess of 2000. Explorer takes more than 5 seconds to...
1
by: Anthony J. Biondo Jr. | last post by:
Hi Everyone: I was wondering if it is common practice to use some sort of messaging (MSMQ, WebSphere MQ) with web services. I understand the need for messaging for insert / update transactions,...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
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: 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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.