473,468 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Combo Box Recordsource When using CodeDB

AP
I am working on an add-on and i have a form with a combo box. if the
user picks one option, the combo box is populated with a query that is
based on a table in the CodeDB, if the user selects another option, the
combo box is populated with a query based on a table in the CurrentDB.
I do not know how to reference the CurrentDb from the CodeDB

I use a SQL string to set the row source of the combo box, something
like,
"Select * from Cities" if it is in the CodeDB and I would like it to do
something like

"Select * from States" from the Current DB, but I do not know how to
reference the currentDB in the SQL string? My only thought is to
manually create a string of the records and set it that way, because I
dont have a problem setting the recordset, I just dont know how to get
it to the combo box.

Any ideas?
Thanks

Dec 19 '05 #1
1 1557
Have both tables (regardless of the resident database) linked to your open
database, then set the recordsource of your combobox to:
= IIF(UserChoice=1, "Select * from Cities", "Select * from States")
-Ed
"AP" <ap******@thompsongroup.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I am working on an add-on and i have a form with a combo box. if the
user picks one option, the combo box is populated with a query that is
based on a table in the CodeDB, if the user selects another option, the
combo box is populated with a query based on a table in the CurrentDB.
I do not know how to reference the CurrentDb from the CodeDB

I use a SQL string to set the row source of the combo box, something
like,
"Select * from Cities" if it is in the CodeDB and I would like it to do
something like

"Select * from States" from the Current DB, but I do not know how to
reference the currentDB in the SQL string? My only thought is to
manually create a string of the records and set it that way, because I
dont have a problem setting the recordset, I just dont know how to get
it to the combo box.

Any ideas?
Thanks

Dec 19 '05 #2

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

Similar topics

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: David Savageau | last post by:
Can anyone help with the following problem? The solution will likely be elementary to many members of this newsgroup, but, Duh! I've been struggling to find it all day. On an Access 2000 form...
3
by: Karl Roes | last post by:
Hi All, I have a form with a standard combo box and 5 tabs in A2003. On Form Open, I set Me.Detail.Visible = False and in the after update event of the combo set Me.Detail.Visible = True,( to...
8
by: bbdata | last post by:
ok i have a problem here and not much time to play round. have a form bound to a table. one of the combos is bound to a field Agents. i have active and retired agents. thing is, i want to be able...
3
by: Stewart | last post by:
Hi all! My (relatively small) database holds data on staff members and the projects (services) that they are assigned to. In my form frmStaff, I have a list of staff members - it is a...
2
by: jambonjamasb | last post by:
What I am trying to do is have a combo box which allows me to filter for a certain field in a subform. I can't think how to do this and have tried with the follwoing code. Basically the field in...
2
by: fredloh | last post by:
i have a table with a yes/no field call "Edited". i have a button that runs code to set the "Edited" field of a selected record to "yes". the code also set the rowsource (using SQL Update and Set...
8
by: troy_lee | last post by:
I want to look at the values of six combo boxes. If any of the boxes are not null, I want to change the value of a separate text box. How can I look at all of them at once? Thanks in advance. ...
7
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm...
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
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...
1
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...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.