A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem with Query/Report



 
 
Thread Tools Display Modes
  #1  
Old July 26th, 2007, 03:42 PM posted to microsoft.public.access.reports
Telobamipada
external usenet poster
 
Posts: 29
Default Problem with Query/Report

I have done some reading on this and want to get on the right track with the
way I am storing data in my tables. I have been working on a database which
contains a form with 2 combo boxes one dependent on the other. The first is
using a table which contains a "BusinessID" field (AUTO Number )and a
"Business" field (Text). I am storing the "BusinessID" field in another table
used on this form. While setting up a report it is pulling the "BusinessID"
and I want to display the "Business" field so that I can see the text. Is
there a lookup or dlookup I can use in a query so that my report will display
the text value for me? Thanks!


--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!
  #2  
Old July 26th, 2007, 11:36 PM posted to microsoft.public.access.reports
Carl Rapson
external usenet poster
 
Posts: 517
Default Problem with Query/Report

"Telobamipada" wrote in message
...
I have done some reading on this and want to get on the right track with
the
way I am storing data in my tables. I have been working on a database
which
contains a form with 2 combo boxes one dependent on the other. The first
is
using a table which contains a "BusinessID" field (AUTO Number )and a
"Business" field (Text). I am storing the "BusinessID" field in another
table
used on this form. While setting up a report it is pulling the
"BusinessID"
and I want to display the "Business" field so that I can see the text. Is
there a lookup or dlookup I can use in a query so that my report will
display
the text value for me? Thanks!


--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


On your report, "hide" the BusinessID control (make its Visible property
False) and add an unbound textbox control (let's call it txtBusiness). Set
the Control Source property of txtBusiness to:

=DLookUp("[Business]","[tblBusinesses]","[BusinessID]=" & Me.BusinessID)

I don't know the name of your table, so I made up the name "tblBusinesses".
You could put this code into the Format event of whichever report section
contains the txtBusiness control instead of in the Control Source of the
control.

Carl Rapson


  #3  
Old July 27th, 2007, 01:34 PM posted to microsoft.public.access.reports
Telobamipada
external usenet poster
 
Posts: 29
Default Problem with Query/Report

Hi Carl, When I enter the DLookUp formula you suggested it wants to keep
putting the Me.BusinessID in brackets...

=DLookUp("[Business]","[tblBusinesses]","[BusinessID]=" & [Me].[BusinessID])

of course then it is prompting for value of "Me"...

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


"Carl Rapson" wrote:

"Telobamipada" wrote in message
...
I have done some reading on this and want to get on the right track with
the
way I am storing data in my tables. I have been working on a database
which
contains a form with 2 combo boxes one dependent on the other. The first
is
using a table which contains a "BusinessID" field (AUTO Number )and a
"Business" field (Text). I am storing the "BusinessID" field in another
table
used on this form. While setting up a report it is pulling the
"BusinessID"
and I want to display the "Business" field so that I can see the text. Is
there a lookup or dlookup I can use in a query so that my report will
display
the text value for me? Thanks!


--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


On your report, "hide" the BusinessID control (make its Visible property
False) and add an unbound textbox control (let's call it txtBusiness). Set
the Control Source property of txtBusiness to:

=DLookUp("[Business]","[tblBusinesses]","[BusinessID]=" & Me.BusinessID)

I don't know the name of your table, so I made up the name "tblBusinesses".
You could put this code into the Format event of whichever report section
contains the txtBusiness control instead of in the Control Source of the
control.

Carl Rapson



  #4  
Old July 27th, 2007, 03:06 PM posted to microsoft.public.access.reports
Telobamipada
external usenet poster
 
Posts: 29
Default Problem with Query/Report

Hello again Carl, I apologize for my own ignorance on this but haven't used
the DLookUp although I do understand why they want us to store data this way
(ID)... I finally worked this out by creating an expression field in my query
and using that in my report instead of trying to work this in the report
itself. Your response was helpful and I appreciate it!
--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


"Telobamipada" wrote:

Hi Carl, When I enter the DLookUp formula you suggested it wants to keep
putting the Me.BusinessID in brackets...

=DLookUp("[Business]","[tblBusinesses]","[BusinessID]=" & [Me].[BusinessID])

of course then it is prompting for value of "Me"...

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


"Carl Rapson" wrote:

"Telobamipada" wrote in message
...
I have done some reading on this and want to get on the right track with
the
way I am storing data in my tables. I have been working on a database
which
contains a form with 2 combo boxes one dependent on the other. The first
is
using a table which contains a "BusinessID" field (AUTO Number )and a
"Business" field (Text). I am storing the "BusinessID" field in another
table
used on this form. While setting up a report it is pulling the
"BusinessID"
and I want to display the "Business" field so that I can see the text. Is
there a lookup or dlookup I can use in a query so that my report will
display
the text value for me? Thanks!


--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


On your report, "hide" the BusinessID control (make its Visible property
False) and add an unbound textbox control (let's call it txtBusiness). Set
the Control Source property of txtBusiness to:

=DLookUp("[Business]","[tblBusinesses]","[BusinessID]=" & Me.BusinessID)

I don't know the name of your table, so I made up the name "tblBusinesses".
You could put this code into the Format event of whichever report section
contains the txtBusiness control instead of in the Control Source of the
control.

Carl Rapson



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.