p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   problem with Auto Number (http://p2p.wrox.com/showthread.php?t=46478)

Brendan Bartley August 14th, 2006 04:07 AM

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

Loralee August 14th, 2006 08:55 AM

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


Brendan Bartley August 14th, 2006 08:58 AM

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

Loralee August 14th, 2006 09:19 AM

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

Are you scrolling your mousewheel AT ALL?

Loralee


Brendan Bartley August 14th, 2006 09:32 AM

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

Loralee August 14th, 2006 09:53 AM

What data type is CUSTID_HDW?

where do you use sValue?


Brendan Bartley August 14th, 2006 10:13 AM

Please ignore svalue
The data type is text

Brendan Bartley


All times are GMT -4. The time now is 09:11 PM.

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