By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,145 Members | 1,619 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,145 IT Pros & Developers. It's quick & easy.

is it that complex?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 Gre,
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 discussion thread is closed

Replies have been disabled for this discussion.