473,385 Members | 1,772 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.

Inserting an Access Database Field into a string of text.

Hi guys, First post here, so please be gentle.

I'm currently writing an Access 2000 Database, and as part of that I need some reports to make use of the information contained in the db.

The reports are largely written and although i'm not a DB expert, i've so far managed to plod through teaching myself what I need, i've now however hit a bump in the road.

I need to insert a field into some text in a report, and I cannot seem to get it to work without Syntax errors.

The Text is:

"The letter has been passed to [Caseworker] who will note its contents. No formal reply appears to be necessary to this letter."

The [Caseworker] part is the field I need to be inserted, i've tried using the expression builder, and simply inserting the field into text. Basically i'm stuck.

I have searched the internet, and particularly this site, to no avail.

Any help would be most appreciated.

Thanks

Martin
Jun 22 '07 #1
3 2108
ADezii
8,834 Expert 8TB
Hi guys, First post here, so please be gentle.

I'm currently writing an Access 2000 Database, and as part of that I need some reports to make use of the information contained in the db.

The reports are largely written and although i'm not a DB expert, i've so far managed to plod through teaching myself what I need, i've now however hit a bump in the road.

I need to insert a field into some text in a report, and I cannot seem to get it to work without Syntax errors.

The Text is:

"The letter has been passed to [Caseworker] who will note its contents. No formal reply appears to be necessary to this letter."

The [Caseworker] part is the field I need to be inserted, i've tried using the expression builder, and simply inserting the field into text. Basically i'm stuck.

I have searched the internet, and particularly this site, to no avail.

Any help would be most appreciated.

Thanks

Martin
In the Format() Event, in the Detail Section of your Report, place code similar to this, just make the necessary substitution for txtInsert:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Me![txtInsert] = "The letter has been passed to " & Me![CaseWorker] & " who will note its contents. " _
  3.                  & "No formal reply appears to be necessary to this letter."
  4.  
  5. End Sub
Jun 22 '07 #2
Hi again.

Firstly thank you for the response to my question.

However I think maybe I mislead you into thinking i was more adept at report writing or Access than I actually am.

From what you wrote, I understood that I needed to enter this into VB (under "view code" function in Access).

I did this, and it brought several errors.

All I wanted to do was insert a field from my database, into a string of fixed text.

So that it read exactly the same, but with the change to the [caseworker]

maybe i'm being thick though

Thanks again
Jun 28 '07 #3
It depends on how the tables have been designed.

you will have contact details of the person you are writing to and a case worker assigned to that person. (whether this is in another table and you are using a number to link them) If you link those two bits of information using a query, use the query as a source for the report and within a text box use:

Expand|Select|Wrap|Line Numbers
  1. ="TEXT" & [caseworder/fieldname] & "Continue text"
I hope this makes sence
Jun 28 '07 #4

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

Similar topics

3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
8
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE(...
9
by: Andrew Banks | last post by:
I'm running the following code in a C#.NET page and it doesn't enter the values into the DB. I'm certain the problem is to do with the txtBirth field. It allows users to enter a DOB as dd/mm/yyyy...
5
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
2
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
Ajm113
by: Ajm113 | last post by:
Ok, when I was new to this I had this problem and I bet a lot of other people did when they where new to PHP and Mysql. So this mite be your question; "Ok, no errors or warnings in mysql and php so...
6
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.