Hi,
I'd like to use a standard value in a field. This value should be the lowest value of a table minus 1. The query I wrote for this works and looks like this: -
SELECT Min(dkey) AS dkeylock
-
FROM VetAbsorptie;
-
Now when I ask for dkeylock with the build function (I select it from the query), access gives me a #NAME? error. Anybody who knows how to solve this??
Greetz
Twanne I made a whole in my brain to fit a mountain 4 1360
I could realy use some help here, the query returns exactly one record so it should work, no? Or is it because I select the field from the query itself?
Greetz
Twanne
Trees are like wood...
You can't use a SELECT query to insert a value into a field. In your case you should use the Dmin function as follows: - dkeylock=DMin("dkey","VetAbsorptie")
Ok, thanks for all the response :p
Found a solution but it is a bit rude:
When you open the form, you can ad a procedure on load. In this procedure I say what the default value for the field is. I had hoped it wouldn't be necessary to write it in vba because I know it is possible from within acces itself.
Didn't find it but if anyone knows the answer I'd like to know it because it closes down my application. Users might mess with code, but they will have a harder time to figure out where the default value is inputed in access itself (no axtra traces). Plus I noticed when you call the Min() function it sometimes failes and makes my db crash :s
Greetz
Twanne [watch the language - you can get your account banned doing this]
Ps. I wrote this while the solution was handed :D
Sorry to break down your solution (it probably works but I don't know exactly how), but it doesn't work here.
Btw. I'm talking about when you right click on a field, then select properties (I think, my access is in dutch), there is a field to specify your default value. DMin("dkey","whatever my table name is") doesn't work there.
Greetz
Twanne Hit the floor at 300 Mph and bounce back Sign in to post your reply or Sign up for a free account.
Similar topics |
by: |
last post by:
If I need to check if a certain value does exist in a field, and return
either "yes" or "not" which query would be the most effestive?
|
by: Nick Truscott |
last post by:
<?
// scoreinput.php - input a match score when match selected from list
?>
<html>
<head>
<basefont face="Verdana">
</head>
<body>
|
by: Bob |
last post by:
Currently I am using this statement to translate 3 fields in my db
thru Visual Basic. I import the data from one table to another then
call the IFF statements and the NewDate to translate the fields. Can
this be done in an Access db? I am trying to learn how to do these
things in Access vs Visual
Dim strIIF As String
Dim sstrIIF As String
Dim strNewDate As Date
|
by: Nicolae Fieraru |
last post by:
Hi All,
I have a table, tblCustomers, with fields SalutationID and Firstname.
I made a query, qrySelect = "Select FirstName from tblCustomers Where
SalutationID = "
If I run this query by itself, it works fine. It asks me for the parameter
and then it shows the records . What I want is to be able to pass the
parameter to it in VBA
I am using the following code:
|
by: Matthew Kramer |
last post by:
How would be the best way to do this in Access?
I have two tables. The first table has all the rows of data. The first
column of this table has a country name, the second has a year and the
third column is the data value.
The second table is just a list of standard years ie. 1980, 1985, 1990,
1995).
Is there a way to arrange a query so that all of the rows in table 1
| |
by: Fendi Baba |
last post by:
I created a person table with various fields such as Suffix,
Salutation, etc, Some of these fields may not be mandatory for example
suffix. In the actual table itself, I only have a field for suffix ID
where 1=Phd, 2= MD. To display all of these to the user, I created a
form with an underlying query. The problem I am encountering is this,
when we have an empty field, for example where ID="", the query returns
nothing. How do i work around...
|
by: TF |
last post by:
This group came through for me last time so here we go again. My page
shows paint colors, brand name, product code, etc in a gridview with
the background matching the paint color. Several links on the page are
used to call itself with querystring values for brand, thinner,
finish, etc. The page must show all colors if the querystring is
empty and filter out records that don't match the querystring value
when it's not. I've tried building...
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
|
by: servantofone |
last post by:
I'm using Access 2003. I'm building a query and wish to display all records with values in a certain field (HIST) made up of all zeros. The field has a range of text values including alpha-numeric characters and may look as follows:
"0000000"
"10112B1A"
"0000"
"***111B001"
"0000000000"
"111000"
"0"
"00000000000"
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |