473,769 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table setup

I need to setup two tables with default information.

First off I need a company table. Quite simple. Name, Address, phone,
tax number and so on. So I have setup that table with the fiels
corresponding to the above.

Question #1

When I print a report I need to look up one value, the tax number. I
assume I use the dLookup function but I get an #Error. Relating to my
up-coming question (#2) I have setup a table called "Misc" with three
fields MiscID, Description and Detail. In my report I have set the
control source as follows:

= =DLookUp("Detai l","Misc","Desc ription = GSTNumber")

Detail - field
Misc - Table
Description = GSTNumber - pointing to the one record that has the tax
number (GSTNumber being the text in the Description field, the actual
number in the Detail field)

I can't get that number.

Question #2

I have the Misc table setup as above. I want to be able to put
defaults in this table and retrieve them later in a form or report. I
would only need to retrieve one value at a time. These values might
be Logo, File Location, Yes/No switches or whatever. Again, I assume
I need to use the dLookup function but it doesn't seem to be working
for me.

I've searched all through the ms-access forum and I know I've seen it
somewhere before but I just can't seem to find it now.

Thanks in advance.
Nov 13 '05 #1
4 1427
Paul,

The problem seems to be in the design of your tables. Try this:
TblCompany
CompanyID
CoName
Address
City
State
Zipcode
Phone
TaxNumber

TblCompanyMisc
CompanyMiscID
CompanyID
Logo
FileLocation
YesNo1
YesNo2
etc

Base your report then on a query that includes both tables.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com
"Paul .V." <pl******@enabl e.org> wrote in message
news:22******** *************** **@posting.goog le.com...
I need to setup two tables with default information.

First off I need a company table. Quite simple. Name, Address, phone,
tax number and so on. So I have setup that table with the fiels
corresponding to the above.

Question #1

When I print a report I need to look up one value, the tax number. I
assume I use the dLookup function but I get an #Error. Relating to my
up-coming question (#2) I have setup a table called "Misc" with three
fields MiscID, Description and Detail. In my report I have set the
control source as follows:

= =DLookUp("Detai l","Misc","Desc ription = GSTNumber")

Detail - field
Misc - Table
Description = GSTNumber - pointing to the one record that has the tax
number (GSTNumber being the text in the Description field, the actual
number in the Detail field)

I can't get that number.

Question #2

I have the Misc table setup as above. I want to be able to put
defaults in this table and retrieve them later in a form or report. I
would only need to retrieve one value at a time. These values might
be Logo, File Location, Yes/No switches or whatever. Again, I assume
I need to use the dLookup function but it doesn't seem to be working
for me.

I've searched all through the ms-access forum and I know I've seen it
somewhere before but I just can't seem to find it now.

Thanks in advance.

Nov 13 '05 #2
Thank you for the quick reply.

Although the solution you stated would work, I already have several
fields in my report and I would like to limit the SQL in order to speed
up the database keeping in mind any future growth.

I did end up finding the problem. Sometimes I just have to step away
from the computer and come back to it. It seems the problem stares me
right in the face then. Anywho, I was using quotes wrong. The correct
use of the dLookup should have been the following:

DLookUp("[Detail]","Misc","[Description] = 'GSTNumber'")

Thank you again,

Paul .V.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
"Paul V" wrote
Although the solution you stated
would work, I already have several
fields in my report and I would like
to limit the SQL in order to speed
up the database keeping in mind
any future growth.


Including extra fields and joins will likely be far, far faster than a
DLookup, which is equivalent to executing a separate additional query for
each and every record. And, in many situations, a query is faster than the
equivalent DLookup, anyway.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #4
"Larry Linson" <bo*****@localh ost.not> wrote in message
news:BH2xd.380$ 1U6.369@trnddc0 9...
"Paul V" wrote
Although the solution you stated
would work, I already have several
fields in my report and I would like
to limit the SQL in order to speed
up the database keeping in mind
any future growth.


Including extra fields and joins will likely be far, far faster than a
DLookup, which is equivalent to executing a separate additional query for
each and every record. And, in many situations, a query is faster than the
equivalent DLookup, anyway.


I agree with Larry. While the domain functions (like DLookup) are often
disparaged beyond what is appropriate, they are NOT suitable in queries,
reports, continuous forms, or code loops. Anything that will call them lots of
times in a row will usually result in a real resource and performance drain.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #5

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

Similar topics

6
130055
by: Michael | last post by:
I have two tables with a 1-many relationship. I want to write a select statement that looks in the table w/many records and compares it to the records in the primary table to see if there are any records that do not match based on a certain field. Here is how my tables are setup: Task Code Table TCode,TCodeFName,Active
1
4332
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a link. 2) The position of this menu is absolute to the page. I want to make it absolute to the Table...
3
752
by: Ben | last post by:
Hi everyone, Now I am using Visual Basic.net to write a program but having some headaches. The situation is as follows: I am using ODBC connection to connect one database( non-SQL server) , which has over 20 tables and each table has lot of fields. My aim is to setup a button, everytime when the button is clicked, the selected tables through the ODBC connection will be copied to a SQL server 2000 ( Both the data and table...
3
4081
by: premmehrotra | last post by:
I am using Access 2000 and Oracle 9.2.0.x on a Windows 2000. I have setup Oracle 9.2 ODBC Driver (I have not yet figured how to set Microsoft's Oracle ODBC driver). I am exporting a table from Access to Oracle and I get following error: ODBC Call Failed: ORA-12571: TNS Packet Failure Error I see table and its indexes created in Oracle. However, there are no
1
3552
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say black for example). I am dynamically creating the LinkButton controls and adding them into the table cell and I've also hooked up an event handler for each LinkButton's Click event. This all works fine. Now in the Link Button's Click event...
1
1511
by: Mark | last post by:
Hi there gurus, can you please add your 2 cents on this design? We're having trouble relating these tables in a diagram because of the keys. Is it necesary to have the references setup? I would assume yes so the forign keys can be setup. If you look at this link, you'll see our diagram. In Red are the relationships that we would like to make for referential integrity, but cannot because of the keys....
10
13414
by: eholz1 | last post by:
Hello Members, I am setting up a photo website. I have decided to use PHP and MySQL. I can load jpeg files into the table (medium blob, or even longtext) and get the image(s) to display without a problem. I am using chunk_split(data) and the base64_encode and base64_decode on the files. I do a select from the database, and then echo the image (with header(Content Type: image/jpeg) and the decoded image displays fine. Yes, I have...
2
3385
by: cj | last post by:
We have a legacy accounting system (not developed in house) here that happens to be written in Visual FoxPro. One of the tables has an index that is actually a coded function COMPANY1 &&"G_RETSDX(COMPANY)". When I try to use this table in VFP I get an error message "File 'g_retsdx.prg' does not exist." I click ok and continue on. We've developed many VFP programs outside the accounting system that use this table and we have to include...
0
1174
by: Nick L | last post by:
Here is the PowerShell script I've been working on (.NET question is at the bottom): ### setup SQL connection $conn = new-object System.Data.SqlClient.SqlConnection $conn.ConnectionString = "server=*****;database=****;UID=*****;PWD=*****" ### setup SQL command $cmd = new-object System.Data.SqlClient.SqlCommand ### Get SQL commands from text file
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10222
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10050
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.