Results 1 to 3 of 3
  1. #1
    d1dodo is offline Novice
    Windows 10 Access 2003
    Join Date
    Apr 2018
    Posts
    6

    Question urgently in need

    guys i have a small database contain a table


    and i have 5 fields then i have created a form i need in that form
    sum between x1 and x2 by using a vba code which i can make event in opening form to summarize the both fields and write the result in xx field
    also i need if i make in b ( checkbox) Yes auto update A (checkbox) to No
    you will find that simple data in attachment
    Attached Files Attached Files

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Base your forms recordsource on a query ( in property sheet, click the elipsis to start the query builder)
    Add an entry X1 + X2. the sql will look like this
    Code:
    SELECT A.id, A.x1, A.x2, A.name, A.xx, A.a, A.b, [x1]+[x2] AS Expr1
    FROM A;
    for the a\b check boxes you could either use an option group or in the after update events of the checkboxes use
    Code:
    Private Sub a_AfterUpdate()
    
        If Me.a = 0 Then
    
    
            Me.b = -1
    
    
        Else
    
    
            Me.b = 0
    
    
        End If
    
    
    End Sub
    
    
    Private Sub b_AfterUpdate()
    
    
        If Me.b = 0 Then
    
    
            Me.a = -1
    
    
        Else
    
    
            Me.a = 0
    
    
        End If
    
    
    End Sub

  3. #3
    d1dodo is offline Novice
    Windows 10 Access 2003
    Join Date
    Apr 2018
    Posts
    6
    thank you bro MR moke123
    first about check box it`s working good
    but about the first question i can do it via

    query but i need it by using a vba code

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

Similar Threads

  1. urgently in need
    By d1dodo in forum Access
    Replies: 6
    Last Post: 04-04-2018, 05:55 PM
  2. Records Disappearing - Urgently need help
    By msmithtlh in forum Access
    Replies: 11
    Last Post: 04-02-2014, 02:37 PM
  3. Replies: 15
    Last Post: 12-28-2011, 05:47 PM

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