Results 1 to 2 of 2
  1. #1
    Tuckejam is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2020
    Posts
    168

    understanding Null Zero

    Need some help understanding the Null Zero please

    I think I understand that it turns a null variant to a zero value, but I don't understand where the need to do that comes from. (and I don't really know what a variant is)

    in the code below we are using a button to open a form and send information about the record selected to the form we are opening
    (selecting a customer record and clicking the edit customer button to open the edit customer form with that selected customers information)

    so, do forms, by default, open with a null (argument? .... value? ... ) and by turning the null into a zero we are just kicking that out of the way so we can do other stuff
    if that's whats happening why do forms default by opening with null

    and on a much deeper level what is the difference between Null and Zero

    Private Sub Form_Open(Cancel As Integer)
    Me.AllowAdditions = False
    Me.AllowEdits = False
    Me.AllowDeletions = False
    If Nz(Me.OpenArgs) <> 0 Then
    Me!CustID.SetFocus
    DoCmd.FindRecord Me.OpenArgs
    Else
    Me.OrderBy = "CustID"
    Me.OrderByOn = True
    End If


    End Sub

    Thanks for the help, it is always greatly appreciated.

  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,651
    heres a pretty good article on nulls

    https://www.utteraccess.com/wiki/Nul...Their_Behavior

    Heres a reference for NZ()
    https://www.techonthenet.com/access/...dvanced/nz.php

    in the code below we are using a button to open a form and send information about the record selected to the form we are opening
    (selecting a customer record and clicking the edit customer button to open the edit customer form with that selected customers information)
    To open a form to a specific record use the Docmd.OpenForm method with a where condition
    https://docs.microsoft.com/en-us/off...docmd.openform

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

Similar Threads

  1. Help understanding invalid use of null
    By Volunteer in forum Modules
    Replies: 15
    Last Post: 10-21-2018, 05:54 AM
  2. understanding Enums
    By George in forum Modules
    Replies: 9
    Last Post: 08-28-2017, 07:43 PM
  3. Am I understanding many to many?
    By dniezby in forum Database Design
    Replies: 10
    Last Post: 04-12-2017, 06:21 PM
  4. Understanding relationships
    By Skywalk669 in forum Database Design
    Replies: 4
    Last Post: 05-01-2012, 03:08 PM
  5. Understanding afterupdate
    By MAM8433 in forum Access
    Replies: 8
    Last Post: 05-23-2011, 02:05 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