Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-02-2019, 09:11 AM   #1
hllary
Newly Registered User
 
Join Date: Sep 2019
Posts: 29
Thanks: 20
Thanked 0 Times in 0 Posts
hllary is on a distinguished road
Form textbox after update clicks check box on subfrom

I have textbox on a form and after it has been updated I would like a check box on a subform to be clicked.

I would like to do this in VBA but I can't get it to work. My code is below.

Code:
Private Sub VarianceNumber_AfterUpdate()
    If (Me.VarianceNumber) = Not Null Then
    Forms![Drawing Implementation subform].Check85 = -1
    End If
    
End Sub

hllary is offline   Reply With Quote
Old 10-02-2019, 09:18 AM   #2
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Form textbox after update clicks check box on subfrom

Code:
Private Sub VarianceNumber_AfterUpdate()
    If  Nz(Me.VarianceNumber, False) Then
        [Drawing Implementation subform]!Check85 = -1
    End If
    
End Sub
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 10-02-2019, 09:20 AM   #3
bob fitz
AWF VIP
 
Join Date: May 2011
Location: Essex England
Posts: 3,532
Thanks: 52
Thanked 684 Times in 666 Posts
bob fitz has a spectacular aura about bob fitz has a spectacular aura about bob fitz has a spectacular aura about
Re: Form textbox after update clicks check box on subfrom

Untested but maybe:
Code:
Private Sub VarianceNumber_AfterUpdate()
    If len(Nz(Me.VarianceNumber,0)) > 0 Then
      Forms![Drawing Implementation subform].Form.Check85 = -1
    Else
      Forms![Drawing Implementation subform].Form.Check85 = 0

    End If
    
End Sub

__________________
Bob Fitzpatrick
Microsoft Community Contributor Award (2011)
If this helped, please click the scales at the bottom left of this posting.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Many thanks.


I have never failed. I have found a thousand ways that do not work!
bob fitz is offline   Reply With Quote
Old 10-02-2019, 09:36 AM   #4
hllary
Newly Registered User
 
Join Date: Sep 2019
Posts: 29
Thanks: 20
Thanked 0 Times in 0 Posts
hllary is on a distinguished road
Re: Form textbox after update clicks check box on subfrom

Quote:
Originally Posted by arnelgp View Post
Code:
Private Sub VarianceNumber_AfterUpdate()
    If  Nz(Me.VarianceNumber, False) Then
        [Drawing Implementation subform]!Check85 = -1
    End If
    
End Sub
I'm getting an error at the If Nz line
hllary is offline   Reply With Quote
Old 10-02-2019, 09:42 AM   #5
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Form textbox after update clicks check box on subfrom

compile your code see where there other errors.
also check for missing Reference.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Reply

Tags
access , form , subform check box

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if a Textbox is empty when closing form Runes Modules & VBA 4 03-17-2016 11:53 PM
Add Yes/ No to Dialogue - When user clicks Yes delete Record when user clicks no keep Sue22 Modules & VBA 5 10-08-2015 05:13 AM
Update of Textbox in Main form from Subform Textbox afterupdate jgitaunjoroge Forms 2 04-19-2015 07:44 PM
Question How to pass value in subfrom update into main form automatic. wping General 0 06-05-2009 12:19 AM
How to disable right clicks on a form? ITHELP85 General 2 11-20-2008 01:18 AM




All times are GMT -8. The time now is 12:08 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World