473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Default Values on New Records

67 New Member
I have no default value set for the StationID field on my Tasks table - in fact, I don't even have that field on my Tasks form. But when I make a new record on the form, a default value is copied into the table. When I make a new record on the table, a default value is not created.

What could be creating that default value when I make a new record using the form, even though that field is not even on the form?

Thanks!

CB55
Mar 11 '08 #1
3 1701
jeffstl
432 Recognized Expert Contributor
I have no default value set for the StationID field on my Tasks table - in fact, I don't even have that field on my Tasks form. But when I make a new record on the form, a default value is copied into the table. When I make a new record on the table, a default value is not created.

What could be creating that default value when I make a new record using the form, even though that field is not even on the form?

Thanks!

CB55
You likely have the StationID field set to autonumber in access?

This would make it automatically populate with an incremental value every new record. This is actually a good way to keep a unique identifier in tables

You dont need to have the value on the form, the databse will do it automatically. Also when you enter a new record in the table you said it doesn't create a value? Did you try tabbing down to the next record? Thats when the insert actually takes place and you will probably see then a value appear.
Mar 11 '08 #2
Coolboy55
67 New Member
You likely have the StationID field set to autonumber in access?

This would make it automatically populate with an incremental value every new record. This is actually a good way to keep a unique identifier in tables

You dont need to have the value on the form, the databse will do it automatically. Also when you enter a new record in the table you said it doesn't create a value? Did you try tabbing down to the next record? Thats when the insert actually takes place and you will probably see then a value appear.
It's true that StationID is an autonumber in the Stations table, but it is a foreign key in the Tasks table and is looked up from the Stations table along with two other columns. The Tasks table does not autonumber the StationID, but for some reason I get a default value when I create a new record in my Tasks form. The default value turns out to be the same as the previous record's value for that field. It is very strange... any other ideas? :/

CB55
Mar 13 '08 #3
jeffstl
432 Recognized Expert Contributor
It's true that StationID is an autonumber in the Stations table, but it is a foreign key in the Tasks table and is looked up from the Stations table along with two other columns. The Tasks table does not autonumber the StationID, but for some reason I get a default value when I create a new record in my Tasks form. The default value turns out to be the same as the previous record's value for that field. It is very strange... any other ideas? :/

CB55
Im not sure. I would have to see the Tasks form code or atleast the portion of code executed when you create a new Tasks record.

If the form is populating that column (StationID) with a number, it has to either be an autonumber or populated in the code when you save a record. Check your binded controls, check if you have any hidden controls or text boxes in design view, etc that may be holding that StationID value and passing it with the Task record being added.
Mar 13 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2775
by: Paul | last post by:
Hi I have a table that currently has 466 columns and about 700,000 records. Adding a new DEFAULT column to this table takes a long time. It it a lot faster to recreate the table with the new...
10
6942
by: serge | last post by:
I am doing a little research on Google about this topic and I ran into this thread: ...
2
10042
by: Todd D. Levy | last post by:
I have a table of Country names & Country codes in alphabetical order. This is a lookup table that a number of other tables use to populate the Country field via a drop down Combo Box on the...
2
1942
by: jerome g | last post by:
Hi, I'm trying to use a (simple) form to create a new record, with all values being default values coming from a previous form. My problem is that I can save that new record only if I change one...
10
2716
by: MLH | last post by:
I have an A97 table with a Yes/No field named TowJob and a form bound to that table. The TowJob control on the form is bound to the same field. It is an option group with Yes and No bttns valued...
1
5988
by: j_ruez | last post by:
I have looked everywhere and honestly can't believe I am the only one trying to figure this out. Maybe I am searching under the wrong keywords. I have a datalist. It is bound to an array, but...
1
2821
by: Matt Tinson | last post by:
Hello I have a datagrid with a datetimepicker column in it, which is bound to a dataset (MyDataset). The column in the dataset set that is mapped to the datetimepicker is called MyOrderDate and...
4
3365
by: helenwheelss | last post by:
Access 2003, using a bound form. I'm seeing rather annoying behaviour when editing data in a control with a default value. It only happens when the form is on a new record. A specific...
4
2967
by: Whasigga | last post by:
Hi I've created a form that has 7 subforms. It is the same subform, bound to a table, just repeated. This form represents a week, and each subform is used to enter in data for each day of the...
2
1693
by: Erland Sommarskog | last post by:
lopina (ivica.lopar@email.t-com.hr) writes: I'm afraid I don't really get your problem. This is legal: create table ferenc (a int NULL DEFAULT NULL) Then again, even without an explicit...
0
7125
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,...
0
7002
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...
0
7205
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...
1
6887
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...
0
5462
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,...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
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...
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.