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 14th, 2006, 04:07 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 problem with Auto Number

Hi All
I have a form and a sub form.On the sub form is an auto number that generates a new number for each new record.The problem I have is that when I select a new record in the form and and then select something in the sub form the auto number is generated but if I then select something in the form the auto number generates again.Is there any way to stop this happening.
Thanks

Brendan Bartley
__________________
Brendan Bartley
Reply With Quote
  #2 (permalink)  
Old August 14th, 2006, 08:55 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Brendan,
Do I understand this? When you click on the Form after creating a new record in it's subform, the Subform adds a new record? Or the Form adds a new record? Are you using the mouse or the tab key?

LOralee

Reply With Quote
  #3 (permalink)  
Old August 14th, 2006, 08: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

when I click on the sub Form a new record is created but when I select from a combo box on the main form again it creates a new record
Thanks

Brendan Bartley
Reply With Quote
  #4 (permalink)  
Old August 14th, 2006, 09:19 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brendan,
What is the code behind the combo click event?

Are you scrolling your mousewheel AT ALL?

Loralee

Reply With Quote
  #5 (permalink)  
Old August 14th, 2006, 09:32 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

The mouse wheel is disabled
the following code is behind the combo box
Private Sub Combo11_AfterUpdate()
    Dim svalue As String



    Dim rs As Object

    Set rs = Me.Recordset.Clone

    rs.FindFirst "[CUSTID_HDW] = " & """" & Me![Combo11] & """"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Brendan Bartley
Reply With Quote
  #6 (permalink)  
Old August 14th, 2006, 09:53 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

What data type is CUSTID_HDW?

where do you use sValue?

Reply With Quote
  #7 (permalink)  
Old August 14th, 2006, 10:13 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

Please ignore svalue
The data type is text

Brendan Bartley
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
Auto Number query again Brendan Bartley Access 4 August 26th, 2006 06:09 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 05:09 PM.


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