Results 1 to 4 of 4
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754

    After Update Event

    Hi all,
    On my form i have a txt field called Attn and a check box that if not null when ticked true, will add that to my temp address...
    I added this msgbox to eliminate an error when ticking the PopulateAttn checkbox if nothing is in the Attn field.
    Code:
    Private Sub PopulateAttn_Click()
    	If IsNull(Attn) Then
    		MsgBox "Attn is blank, you must assign to someone's attention"
       		Me.PopulateAttn = False
    	End If
        		UpdateTempAddress
    End Sub
    I want to add to this if I tick the checkbox to = false (Untick it) and there is something in Attn, it will clear the the Attn field.
    So basically if my name is in Attn field and I tick the check box it will put in what is in the Attn box into my temp address field.
    If I untick that box, i want it to remove my name.....

    Any assistance would be wonderful...


    Thanks
    Dave

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    try
    Code:
    Private Sub PopulateAttn_Click()
    If IsNull(Attn) And Me.PopulateAttn =  True Then
      MsgBox "Attn is blank, you must assign to someone's attention"
      Me.PopulateAttn = False
      Exit Sub
    End If
    
    If Me.PopulateAttn = False Then 
      Me.Attn = Null
    End If
    
      UpdateTempAddress
    End Sub
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754
    Worked perfect, thank ou so much!

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You're welcome - but be sure by testing with all scenarios that you can think of.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-27-2019, 10:58 AM
  2. Replies: 6
    Last Post: 11-05-2014, 05:27 PM
  3. Replies: 7
    Last Post: 05-08-2014, 10:34 AM
  4. Before Update Event Help
    By bklewis in forum Access
    Replies: 8
    Last Post: 03-25-2012, 03:58 PM
  5. Before Update Event
    By randolphoralph in forum Programming
    Replies: 0
    Last Post: 06-15-2010, 09:26 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