By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,377 Members | 3,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,377 IT Pros & Developers. It's quick & easy.

Auto number problem

P: 24
I have builed a database in access and using forms of Visual Basic6
The problem is this
I have a field Id which is of type long and autoincrement
Now when i create a form and run and type my frist entry in id field like 1
it give me the message field is not updateble.
Plese tell me what the problem is this and how i can over come this problem.
and how it will show ID field first auto number automatically.

[HTML]ARALI[/HTML]
Jan 12 '08 #1
Share this Question
Share on Google+
5 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Yes, Auto Increment Field cannot be Editted.
If you want to show the next number, follow these steps:

Create A Query Object with following query:
SELECT Max(SlNo)+1 AS NextNumber FROM MyTable;
Save with Some name.

Now Create a Form For this Query... say frmNextNumber

Drag and Drop This frmNextNumber on your Main Form..

Regards
Veena
Jan 12 '08 #2

Expert 5K+
P: 8,434
...Now Create a Form For this Query... say frmNextNumber
Drag and Drop This frmNextNumber on your Main Form
Unless, of course, you happen to be using Visual Basic for the forms, rather than Access. In which case this may not apply.

But as QVeen72 points out, the whole point of an "autonumber" field is that the value is generated automatically by Access. You can display it, but you cannot edit it.
Jan 13 '08 #3

P: 24
Hi,

Yes, Auto Increment Field cannot be Editted.
If you want to show the next number, follow these steps:

Create A Query Object with following query:
SELECT Max(SlNo)+1 AS NextNumber FROM MyTable;
Save with Some name.

Now Create a Form For this Query... say frmNextNumber

Drag and Drop This frmNextNumber on your Main Form..

Regards
Veena
Hello Veena
Thanhs for your help but iwas unable to do what you said.
Please tell me how to drag and drop a form on another form
and tell what to do with my problem other than that.
Regards
[HTML]ARALI[/HTML]
Jan 14 '08 #4

QVeen72
Expert 100+
P: 1,445
Hello Veena
Thanhs for your help but iwas unable to do what you said.
Please tell me how to drag and drop a form on another form
and tell what to do with my problem other than that.
Regards
You are using VBA..? or VB6..?

Regards
Veena
Jan 14 '08 #5

P: 24
You are using VBA..? or VB6..?

Regards
Veena
I am using Vb 6
Regards
ARALI
Jan 14 '08 #6

Post your reply

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