Default Value Problem

  • Thread starter Thread starter jwr
  • Start date Start date
J

jwr

I posted this in query and got no response. Hope this doesn't create a
problem reposting.


I have a table with two fields in which I have entered default values in the
default field at the bottom of the table-
"N" and the second field "C".

When I run a query, that information is not automatically inserted into the
query. What should I look for that I might be doing wrong?

Thanks
 
I posted this in query and got no response. Hope this doesn't create a
problem reposting.


I have a table with two fields in which I have entered default values in the
default field at the bottom of the table-
"N" and the second field "C".

When I run a query, that information is not automatically inserted into the
query. What should I look for that I might be doing wrong?

A Default Value merely assigns a value to the field *when a new record
is created in the table*.

Running a Query (except for a MakeTable or Append query) does not
create any new record.

Could you explain what you *expect* to happen? How are you running the
query, and what query are you running?

John W. Vinson[MVP]
 
I have two fields in my table that have a default value. When I added them
to my query, the default value does not appear in those fields when I run
the query -- it is blank.

Floor Plan and Type of Sale should insert "N" for floor plan and "C" for
Type of Sale.

The SQL is below:

PARAMETERS [Specify ControlNum] Text ( 255 );
SELECT Dealer.DealerName, Customers.ControlNum, Orders.ShipDate,
Orders.OrderID, [Order Details].Quantity, Products.ProductCode,
Products.ProductName, [Order Details].SerialNum, Dealer.DlvDlrJDInv,
Dealer.[JDInv$], Orders.FloorPlan, Orders.TypeSale, Orders.County,
Orders.CountyCode, Orders.CustType, Orders.UseType
FROM (Dealer RIGHT JOIN (Customers INNER JOIN Orders ON Customers.CustomerID
= Orders.CustomerID) ON Dealer.DealerID = Orders.DealerID) INNER JOIN
([Order Details] INNER JOIN Products ON [Order Details].ProductID =
Products.ProductID) ON Orders.OrderID = [Order Details].OrderID
WHERE (((Customers.ControlNum)=[Specify ControlNum]));
 
I have two fields in my table that have a default value. When I added them
to my query, the default value does not appear in those fields when I run
the query -- it is blank.

Your understanding of how default values work appears to be in error.

Opening a Query on an existing record - which your query does - WILL
NOT, and should not, and is not designed to, cause any Default values
to appear. It will show only those values which *already exist* in the
table. If the record displayed in the query has some other value, or
NULL, in those fields, that's just exactly what you will see.

If the query is updateable and you go down to the "new record" blank
row and type a value in, *then* the default value will be applied.


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top