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

Use text for table field name

1
I am trying to use a record field date as the field name of a different table.

Expand|Select|Wrap|Line Numbers
  1. Function SetChangeOnInactive()
  2. ' This routine will set the Closed Area change flag if someone with
  3. ' Open/Close in that area changes to inactive.
  4. Dim db As Database, qryString As String, Area As String
  5. Dim area_rst, name_rst
  6.  
  7.     Set db = CurrentDb
  8.     ' First find any not in the master database
  9.     Set name_rst = db.OpenRecordset("qrySelectNotInMasterDB", dbOpenDynaset)
  10.     Set area_rst = db.OpenRecordset("tblClosedArea", dbOpenDynaset)
  11.     Do Until name_rst.EOF ' For each person identified
  12.         Do Until area_rst.EOF ' For each area they might have access
  13.             Area = area_rst![ClosedArea]
  14.  
  15.             ' It works until I get to this line. Area contains the field name in area_rst
  16.             If Not IsNull(name_rst!["Area"]) Then ' Set the table flag
  17.                 area_rst![ContentChange] = True
  18.  
  19.             End If
  20.             area_rst.MoveNext
  21.         Loop
  22.         name_rst.MoveNext
  23.     Loop
  24.  
  25.     area_rst.Close
  26.     name_rst.Close
  27.  
  28. End Function
  29.  
Jul 6 '07 #1
1 1578
MMcCarthy
14,534 Expert Mod 8TB
Try something like this ...

Expand|Select|Wrap|Line Numbers
  1. ' It works until I get to this line. Area contains the field name in area_rst
  2. If Not IsNull(name_rst!(Area) Then ' Set the table flag
  3.         area_rst![ContentChange] = True
  4. End If
  5.  
Jul 17 '07 #2

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

Similar topics

6
by: Steve Speirs | last post by:
Hi I'm trying to show/hide a simple piece of text and a text field on a form based on what choice is made from a drop down box. <select name="dropdown" size="1"> <option selected...
5
by: simon_s_li | last post by:
Hi, I have 5 fields in line where I need to drag and drop the text from one field to another field and then all the fields need to re-order themselves. So for instance if I drag the text in...
4
by: N. Graves | last post by:
Hello; I have a table that is equipment. This table has a filed called Owner and that Owner filed is Looked up from a table called employee. and the query request the serial number of the...
6
by: Kevin Chambers | last post by:
Hi all-- In an attempt to commit an Access MDB to a versioning system (subversion), I'm trying to figure out how to convert a jet table's metadata to text, a la SaveAsText. The end goal is to...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
2
by: Roger | last post by:
I've got two tables in sql2005 which have an 'ntext' field when I linked the first table in access97 last week using an odbc data source the access-field type was 'memo' when I link the 2nd...
1
by: Achtland | last post by:
Hi all, I'm rather new to XSL (and this forum) and have searched everywhere to find out how to order the output of XML to text using XSLT but haven't found the answer. The XML is similar to...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.