473,378 Members | 1,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,378 software developers and data experts.

Getting the contents of a field!!

I'm lost on somethingthat I feel ought to be simple - getting the contents
of a field!

The database relates to school students and their subjects. The current
record has as its source a query which combines a number of tables, each for
a specific subject. These have a number of common fields such as 'target'.
I want to fnd say the total or average of target for those different
subjects. I have all the subject names sitting in an array.
Subject(1)-"En" etc. Just to see I've got it can do
Something = [En].[Target]
MsgBox Something produces 6
but
Something = "[" & Subject(1) & "].[Target]" produces "[En].[Target]" not
the contents of field!
I've tried brackets all over the place an ' not "

I feel the solution is so obvious but I can't see it.
Nov 13 '05 #1
3 1303
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:ck*******************@news.demon.co.uk...
I'm lost on somethingthat I feel ought to be simple - getting the contents
of a field!

The database relates to school students and their subjects. The current
record has as its source a query which combines a number of tables, each for a specific subject. These have a number of common fields such as 'target'. I want to fnd say the total or average of target for those different
subjects. I have all the subject names sitting in an array.
Subject(1)-"En" etc. Just to see I've got it can do
Something = [En].[Target]
MsgBox Something produces 6
but
Something = "[" & Subject(1) & "].[Target]" produces "[En].[Target]" not
the contents of field!
I've tried brackets all over the place an ' not "

I feel the solution is so obvious but I can't see it.


Something = Me("[" & subject & ".Target]")
Nov 13 '05 #2
"Brian" <bc**@IHATESPAMclara.co.uk> wrote in message
news:10***************@echo.uk.clara.net...
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:ck*******************@news.demon.co.uk...
I'm lost on somethingthat I feel ought to be simple - getting the contents of a field!

The database relates to school students and their subjects. The current
record has as its source a query which combines a number of tables, each

for
a specific subject. These have a number of common fields such as

'target'.
I want to fnd say the total or average of target for those different
subjects. I have all the subject names sitting in an array.
Subject(1)-"En" etc. Just to see I've got it can do
Something = [En].[Target]
MsgBox Something produces 6
but
Something = "[" & Subject(1) & "].[Target]" produces "[En].[Target]" not the contents of field!
I've tried brackets all over the place an ' not "

I feel the solution is so obvious but I can't see it.


Something = Me("[" & subject & ".Target]")


Sorry, forgot the subscript, that should of course be:

Something = Me("[" & subject(1) & ".Target]")

Nov 13 '05 #3
You might try
Something = Eval("[" & Subject(1) & "].[Target]")

"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:ck*******************@news.demon.co.uk...
I'm lost on somethingthat I feel ought to be simple - getting the contents
of a field!

The database relates to school students and their subjects. The current
record has as its source a query which combines a number of tables, each for a specific subject. These have a number of common fields such as 'target'. I want to fnd say the total or average of target for those different
subjects. I have all the subject names sitting in an array.
Subject(1)-"En" etc. Just to see I've got it can do
Something = [En].[Target]
MsgBox Something produces 6
but
Something = "[" & Subject(1) & "].[Target]" produces "[En].[Target]" not
the contents of field!
I've tried brackets all over the place an ' not "

I feel the solution is so obvious but I can't see it.

Nov 13 '05 #4

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

Similar topics

12
by: Adam Lipscombe | last post by:
Folks, I need to get the contents of a form attribute. In Read/Write mode this is field, so I can use getElementById("name").value In ReadOnly this is just plain text, so I can use...
2
by: clintonG | last post by:
I'm trying to get the file name returned in a server variable and am really feeling dumb because I haven't figured out how to use the available methods correctly to get the contents of the array...
0
by: Child | last post by:
i have an editable datagrid, which screws up my date every time. Can you please advise? I am retrieving the edited data using the following code. I am certain is the ctype causing the problem. ...
1
by: IndyChris | last post by:
I am attempting to add a drill down datagrid to my webpage so the user will not have to leave the page to get further information on a row. There are 12 other columns before this column....
4
by: Aneri | last post by:
I want to show a same field from database twice each with different conditions in datagrid.I use Oracle as back-end. I use self join as below: sql2 = "select m1.int_no(select int_no from...
1
by: harini | last post by:
hi, i am working on asp.net with c#. i have a datagrid populated to a datatable...i havent used a DB...i have created a datatable and filled values in it thru code... now i need to get the...
1
by: lizarraga | last post by:
I have a table this table sep 2007 = 1.7890 oct 2007 = 1.8952 nov 2007 = 1.8970 in the field (date) sep 2007 the problem is and and other field get 1.7890
4
by: Bob Alston | last post by:
My client insists that the printed copy of text entered into a memo field have EXACTLY the same layout as it appears on the screen. I found I had to eliminate the vertical scroll bar. Then I...
4
by: JimCarlson | last post by:
I have a form where the user selects the type of time off they wish to request. It is defined as follows: Control Source: Time Off Type (data type is Text and field size =1) Row Source Type: ...
2
by: timleonard | last post by:
How do you reference the Table:Field to use in a file path? I have been trying the code below I would like to reference a Tablel:Field to use in the path instead of hard coding the file name,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...

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.