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

Rename a field name using code with variables

Hi, can anyone help me with the code necessary to rename a field in an access table. I have tried the ALTER TABLE method but it doesn't like my variable names. Here is the code and thank you for any help!
ALTER TABLE tblClientTable RENAME COLUMN fldRateField TO "MarketPrice"
Oct 12 '06 #1
3 5416
MMcCarthy
14,534 Expert Mod 8TB
Take the quotes of MarketPrice.



Hi, can anyone help me with the code necessary to rename a field in an access table. I have tried the ALTER TABLE method but it doesn't like my variable names. Here is the code and thank you for any help!
ALTER TABLE tblClientTable RENAME COLUMN fldRateField TO "MarketPrice"
Oct 14 '06 #2
I took the quotes off MarketPrice, but I still get a compile/syntax error and my variable tblClientTable seems to be the problem. Could it be that I haven't declared this variable properly?

Dim fldRateField As String
Dim tblClientTable As String
fldRateField = Forms!frmDailyClient!lstFieldList
tblClientTable = Forms!frmDailyClient!lstTableList
ALTER TABLE tblClientTable RENAME COLUMN fldRateField TO MarketPrice

Thank you for any additional help!
Oct 16 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
Try:

Dim fldRateField As Field
Dim tblClientTable As Table


I took the quotes off MarketPrice, but I still get a compile/syntax error and my variable tblClientTable seems to be the problem. Could it be that I haven't declared this variable properly?

Dim fldRateField As String
Dim tblClientTable As String
fldRateField = Forms!frmDailyClient!lstFieldList
tblClientTable = Forms!frmDailyClient!lstTableList
ALTER TABLE tblClientTable RENAME COLUMN fldRateField TO MarketPrice

Thank you for any additional help!
Oct 16 '06 #4

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

Similar topics

3
by: Venkat | last post by:
Hi All, Currently i guess rename and remove are not supported using fstream. How do i rename or remove a file? regards, Venkat
7
by: Tom | last post by:
I'm having a problem using a path with spaces as a parameter to os.rename() in a program on WinXP. This works fine at the command line (where the folder "c:\aa bb" exists) > os.rename( "c\aa...
8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
1
by: Shimon Sofer | last post by:
Hello Does anybody know how to change table name (and field name) using SQL query ? I want to use it from Delphi/ADO. Thanks
1
by: solar | last post by:
In my subform i have controls which i want to rename but i do not want to change the real names of the fields in the tables,nor add the name to the Caption in the field of the table.Is it possible...
2
by: AA Arens | last post by:
During my database construction, I left the names of the buttons, comboboxes named by default like Combo77, Command43. I can rename them with Properties Other Name, but them I start getting...
12
by: mantrid | last post by:
Im trying to move a file but am having luck my code is below. The temp and target paths are valid as they echo correctly. but I cant get the copy() function to work, or the rename() function ...
2
by: tanichka | last post by:
Hello you helpful folk! Please look at my script and tell me what I am doing wrong! I am cleaning the names of my music files from unnecessary symbols, and the cleaning works fine, however the perl...
7
by: Bob Altman | last post by:
Using VS 2008 SP1, is there a way to rename a CSS style and all of the references to that style (short of doing a global find-and-replace in the code)? You'd think that the Manage Styles and Apply...
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: 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
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
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
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.