473,378 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

AutoNumber field in a form Access 2007.

1
Howdy,

I am mainly a MySQL user but I have been playing with Access 07 a little bit recently. I created a database with 3 tables.

Table ID ---
userID -- AutoNumber
UserInfo - userID (linked to ID.userID
fname -- text
lname -- text
age -- number
Usermoreinfo - userID (linked to ID.userID)
college -- text

So i made a form using the 'form wizard' and i assumed that because userID is an autonumber field it would've just automagically inserted a row in that table/field first because everything else relies upon that. I was wrong, so i created a second form with all of the above fields.

So now i have a form with:

userID
fname lname
age
college

it wont let me do inserts because it tells me userID is an autonumber field if i enter anything in that text box, if i dont enter anything in that text box it tells me the primary key cant be NULL... kind of a catch22 huh??

can anyone explain this to me? i could do this with MySQL in two queries by just getting the last insert id but i'm trying to do something different/new.

thanks for any advice.
BMF
Dec 7 '07 #1
1 3028
hjozinovic
167 100+
hi BMF!

You seem to have a problem with ID table. Basically it's not needed! You should put the info about one entity into only one table. (User is an entity for itself).
Try to change your tables as I did in Test file attached to this reply.
I hope this design will be acceptable for you.

I'll be here for future questions you might have.
H.
Attached Files
File Type: zip Test-v1.zip (29.3 KB, 180 views)
Dec 10 '07 #2

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

Similar topics

33
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
2
by: Ed Havelaar | last post by:
Hi, Hope someone can help. Here's the scenario: I have two MSAccess tables MainTab and SubTab. MainTab has an autonumber 'id' column as primary key. Subtab has this id column as a foreign...
3
by: Ralph Birden | last post by:
Hi all, Here's my situation: I have 2 tables, let's call them TableA and TableB. TableA has a primary key called AffNo, TableB's primary key (--> foreign key in TableA) is called ID, and is...
4
by: dhcomcast | last post by:
We're starting to use Oracle for the back-end instead of a separate Access .mdb file for the data and everything as gone surprisingly well so far. We are learning Oracle as we go; Yikes! But we...
3
by: ThompsonJessical | last post by:
I am using an autonumber as a form id with a SubForms (which automatically fill the linking fields from the parent into the child). Occasionally (maybe 5% of the time) the autonumber does not...
7
by: jmar | last post by:
I'm hoping someone out there can give me a little guidance. I have an Access Database "Customer.MDB" with a table "CustInfo" that has the following design: Field: DataType CustID AutoNumber...
9
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
4
by: Lyn | last post by:
Hi, Is there an "easy" way to write a full record (all fields) using "INSERT INTO..." into a table which has an AutoNumber field? Normally, to write a full new record I would use: INSERT INTO...
6
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.