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

How to change the Row source in a table to a query?

547 512MB
I have had to change the names of some fields in a table and this resulted in comboboxes not working anymore.
My plan is to create a query based on the new field names/table name, and then replace the current Row source with that.(the field and table names have been changed using VBA already)
This is some code for an existing combobox on a form to change it to a query.
Expand|Select|Wrap|Line Numbers
  1. Forms!Employees!cmboNames.RowSourceType = "Table/Query" 
  2. Forms!Employees!cmboNames.RowSource = "EmployeeList"
How do i adapt it please?
I want to change the sql in the original table to a query name but leave the rest of the properties and sizes the same. Is it possible?

Attached Images
File Type: jpg rowsource change.jpg (20.4 KB, 640 views)
Jul 10 '13 #1
1 2087
zmbd
5,501 Expert Mod 4TB
This is hard to follow and you've started mixing terms:
want to change the sql in the original table to a query name but leave the rest of the properties and sizes the same. Is it possible?
What are you doing?


You can, at runtime, alter the controls recordsource property such as:
Expand|Select|Wrap|Line Numbers
  1. strSQL = "some valid SQL here, or a query or table name"
  2. me.cboCtrl.recordsource = strSQL
Using the same concepts, one can go thru the forms collection, then step thru each form's control collection, searching for the temrs to change. There was something written here on Bytes about doing something along those lines; however, I can't find the link today.
Jul 10 '13 #2

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

Similar topics

2
by: znelson | last post by:
I'm looking for a way to transform the contents of n source tables into a single destination table. This by itself is no problem. However, the name of the source tables change, so I'll need to...
0
by: Gianfranco | last post by:
Hi I got a problem with 2 tables. I have a table, say A, with x records, coming from a make table query and a table, say B, with y records, coming from another make table query. I need to join...
4
by: Oreo Bomb | last post by:
I have a secured database that contains a Read-Only group. This group has permissions to view reports, but cannot add, edit, or delete any DB objects. One of the reports the group needs access to...
3
by: Hanif Merali | last post by:
Hello, I'm having some difficulties creating a make table query. The source table which I'm basing the make table query has the fields: CIF BusLine1-2001 BusLine1-2002 BusLine1-2003...
4
by: Alan Lane | last post by:
Hello world: I'm including both code and examples of query output. I appologize if that makes this message longer than it should be. Anyway, I need to change the query below into a pivot table...
3
by: jpatterson | last post by:
Hi, I need to be pointed in the right direction. I'm looking for a way to dynamically change a table in a query. I have a table called students and each fiscal year the student table will get...
5
by: agarwasa2008 | last post by:
Hi, I have a linked table called tbltest and some bounded forms (which add, update, delete records) that were created using that linked table. For some necessary reasons I had to create another...
9
by: Mourad | last post by:
Hi All, Is it possible to create a Make Table query in access (2.0 and 2003) that creates the table into a SQL Server database? Following the steps: 1- Create New Query 2- Set Query Type as...
7
by: Henry J. | last post by:
I got a dumb question on the merge statement. I read the following example of merge statement at the IBM page:...
2
by: Laurel | last post by:
I am completely new to access. I have a make-table query that combines data from two/more tables, asks for a criteria, deletes the old table and produces a new table every time under the same name....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.