Results 1 to 2 of 2
  1. #1
    wasim_sono is offline Advanced Beginner
    Windows XP Access 2013 64bit
    Join Date
    May 2005
    Location
    Pakistan
    Posts
    73

    Befor update event

    I have a form having many fields. one field is bill_no and another is BillID.


    Bill no is same for some records but BillID is a sequential number which is unique for every record. What I need is that when bill_no change the BillId set to zero and start again from 1. For Example

    • Bill No Bill Date Bill ID Emp No Amount

      ba/02/01 ...... 1 23445 45
      ba/02/01 ...... 2 23568 50
      ba/02/01 ...... 3 25896 60
      ba/02/01 . ..... 4 25635 105
      ......

      ba/02/01 ...... 1 56324 52

    for this Iused following on before update event of bill_no as

    Code:
    Private Sub bill_no_BeforeUpdate(Cancel As Integer)
    Dim ID As Integer
    ID = 1
    If IsNull(Me![bill_no]) Then
        MsgBox "Field can't be empty"
           Me.[bill_no].SetFocus
     Cancel = True
     End If
    End Sub
    and after update event of another field as
    Code:
    Private Sub com_ref_AfterUpdate()
    Me.SlipID.Value = Me.SlipID.Value + 1
    Me.SlipID.DefaultValue = Me.SlipID.Value
    
    End Sub
    Its working fine but as the bill no change the value of SlipID doesn't change . I want to initialize it from 1 again.


    Wasim

  2. #2
    wasim_sono is offline Advanced Beginner
    Windows XP Access 2013 64bit
    Join Date
    May 2005
    Location
    Pakistan
    Posts
    73
    O God there's nothing. No one answer me. I think I couldnot describe in right way. Please tell me if u all need more information or these words a flying over ur heads. I need help to run my application. Please response me in any way either u have solution it or not. If I place my problem in other forum then I hope u will never mind it.



    Thanks.

    Wasim

Please reply to this thread with any new information or opinions.

Similar Threads

  1. form_current event question
    By edo in forum Forms
    Replies: 0
    Last Post: 09-08-2008, 02:54 PM
  2. Form Event Question
    By protean_being in forum Forms
    Replies: 3
    Last Post: 05-06-2008, 10:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums