Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 22nd, 2006, 10:58 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default Auto Number query again

Hi All again
I have set up my main form customer details and my sub form auto number and other details
When I have logged details against a customer I want to click a command button and clear the details and save the record
When I try to do this I get a error message with the auto number what can I do to stop this.
Thanks

Brendan Bartley
__________________
Brendan Bartley
Reply With Quote
  #2 (permalink)  
Old August 22nd, 2006, 11:51 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I don't know what you mean by "clear the details and save the record."

Normally you have a main form and sub form, and the subform keeps records related to the main form record.

It sounds like you want to add records to the sub form related to the main form, then click a button which clears the data entry you just did, and then saves the data somewhere else. Is this correct? If so, why?

The autonumber field error in this case would be because you are taking a number from one table/field (on your sub form?) and trying to push it into another table's autonumber field. You can't do this. auto means auto. If you want to save the auto number generated in the first sub form, change the autonumber field in the second table to Number (integer).

Does this help?


mmcdonal
Reply With Quote
  #3 (permalink)  
Old August 22nd, 2006, 11:56 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for you're reply
No there is only one auto number in the sub form.
I want to insert a submit button that clears all the records from the sub form
this includes the auto number
Thanks

Brendan Bartley
Reply With Quote
  #4 (permalink)  
Old August 22nd, 2006, 11:59 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure why you are clearing records from a subform. What is the table that the form is built on?

I would take the PK (autonumber) field in a variable, then do

DELETE FROM tblYourSubFormTable WHERE [PK] = PKfromSubForm

Don't delete it from the sub form, delete it from the underlying table.

Does this help?

mmcdonal
Reply With Quote
  #5 (permalink)  
Old August 26th, 2006, 06:09 AM
Authorized User
 
Join Date: May 2006
Location: delhi, delhi, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello, sir
I have a field naming Diary_number it is autonumber, it start from 1 but i want to start my diary number from 1401, is it possible or not, if it is possible then please help me and tell me how


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with Auto Number Brendan Bartley Access 6 August 14th, 2006 10:13 AM
auto generate an number utarian Access 2 March 28th, 2005 02:24 AM
[b]Auto Number[/b] vanjamier Classic ASP Databases 1 November 18th, 2004 03:44 AM
Auto number yami56 Access 1 August 20th, 2004 11:24 AM
Auto number Sheri Dreamweaver (all versions) 0 December 22nd, 2003 03:36 PM



All times are GMT -4. The time now is 10:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.