![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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("Detail","Misc","Description = 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. |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
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. |
#5
| |||
| |||
|
|
"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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |