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

is it that complex?

Hi,

I have a problem to print the correct data to a file.

I have two tables:
1. "names" with the records
- "id" (autonumber / primary key)
- "description" (text)

2. "things" with the records
- "date" (date)
- "object" (memo)
- "name" (this refers isong lookup to table "names" the record "id")
I do:

print #1, rstfile2!date
print #1, rstfile2!object
print #1, rstfile2!name

As expected I get a number on the third print-command. I tried several
things to get the "description" of the "id" printed but didn't succeed.

Even when I do a

Select Case rstfile1!id
Case rstfile2!name
Print #1, rstfile1!description
End Select

while looping rstfile2 it doesn't work. Above that I think it could be done
much more easy than using the Select Case and looping-story. But how?

Thanks,

Sjoerd
Nov 13 '05 #1
2 1610
The problem is that you're using a lookup field in your "things" table. It
may look as though you're storing the description, but it's not present in
the table. You need to create a query that joins your table to the table
that contains the description, and get the description that way.

This is one of the reasons we recommend never to use the Lookup field type
(see "The Evils of Lookup FIelds in Tables" at
http://www.mvps.org/access/lookupfields.htm )

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"asd987" <as****@home.nl> wrote in message
news:c8**********@news2.tilbu1.nb.home.nl...
Hi,

I have a problem to print the correct data to a file.

I have two tables:
1. "names" with the records
- "id" (autonumber / primary key)
- "description" (text)

2. "things" with the records
- "date" (date)
- "object" (memo)
- "name" (this refers isong lookup to table "names" the record "id")
I do:

print #1, rstfile2!date
print #1, rstfile2!object
print #1, rstfile2!name

As expected I get a number on the third print-command. I tried several
things to get the "description" of the "id" printed but didn't succeed.

Even when I do a

Select Case rstfile1!id
Case rstfile2!name
Print #1, rstfile1!description
End Select

while looping rstfile2 it doesn't work. Above that I think it could be done much more easy than using the Select Case and looping-story. But how?

Thanks,

Sjoerd

Nov 13 '05 #2
asd987 :
Hi,

I have a problem to print the correct data to a file.

I have two tables:
1. "names" with the records
- "id" (autonumber / primary key)
- "description" (text)

2. "things" with the records
- "date" (date)
- "object" (memo)
- "name" (this refers isong lookup to table "names" the record "id")
I do:

print #1, rstfile2!date
print #1, rstfile2!object
print #1, rstfile2!name

As expected I get a number on the third print-command. I tried several
things to get the "description" of the "id" printed but didn't succeed.


if you don't want (or can) change the data source for the export, use:

print #1, dlookup("description","names","id=" & rstfile2!name)

but this is quite slow on large exports, since each lookup has to be
done seperately.

BTW, don't use "name" as column name because it's used internally too.
Viele Grüße,
Sascha Wostmann
--
wichtige Informationsquellen zu Access: +----------------------
http://www.donkarl.com/ (FAQ) | Bitte keine Kopien
http://www.freeaccess.de/ (KnowHow) | oder Access-Anfragen
http://www.google.de/ (Suchmaschine) | per E-Mail.
Nov 13 '05 #3

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

Similar topics

34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
4
by: Mantorok Redgormor | last post by:
With what specifier do I use to print a variable of a complex type? The man page for printf doesn't even say. - nethlek
5
by: ma740988 | last post by:
Trying to determine how to get the max element from a complex sequence. Given: int main() { //typedef std::complex < double > C typedef std::vector < std::complex < double > > complex_vec;...
2
by: Arvid Requate | last post by:
Hello, I'd like to understand why the following code does not compile. It looks like a strangeness in connection with overload resolution for the <complex> header: The conversion operator...
7
by: Tina | last post by:
Dear all, I'm looking for a routine which calculates the Gamma Function for a complex valued variable. I'm using #include <complex> to work with complex numbers. I define a complex number...
1
by: jraul | last post by:
Suppose we have a complex number class and we overload the conversion to double to return the real part. We also overload operator* to do complex multiplication. Consider now: complex a(...);...
2
by: Mr. Ken | last post by:
H, there I am writing some simulations with complex calculations, where can I find a complex.h and complex.cpp to include in my application? I am using Dev-C++ 4.9.8. Thanks in advance
14
by: David Marsh | last post by:
Can someone show me or point me to an example of declaring and initializing complex numbers in C99? Also, in looking at complex.h, I don't see any library calls for + - * or /. How are the basic...
11
by: jacob navia | last post by:
hi I am trying to use the complex data type. Consider this code, taken from the cclib library: struct complex csqrt(Cpx z) { double r; r=sqrt(z.re*z.re+z.im*z.im);...
9
by: void main | last post by:
I'm rather new to complex numbers in C and was wondering, how do I initialize a complex variable properly if the imaginary part is 0. I tried -------- #include <complex.h> float complex c...
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.