Results 1 to 4 of 4
  1. #1
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110

    Date is null ???


    Hi Guy,

    I've did lot of searching and i still not able to find out what's the issue.

    Code:
    Private Sub Form_Open(Cancel As Integer)
    
    Dim LValue As String
    
    
    LValue = Format(Date, "YYMM")
    
    
    MsgBox (LValue)
    
    
    'Me.txtscar = Nz(DMax(" SCAR ", "F1NCtbl", SCAR = LValue), 0) + 1
        Me.txtsequence = Format(Nz(DMax("Sequence", "F1NCtbl", "YYMM = '" & LValue & "'"), 0) + 1, "00")
    
    
    Me.txtscar = "ANC" & LValue & Me.txtsequence
    
    
    'Me.txtsequence = Nz(DMax("Sequence", "F1NCtbl", "YYMM = '" & LValue & "'"), 0) + 1
    
    
    Me.Dirty = False
    
    
    End Sub
    Click image for larger version. 

Name:	date.JPG 
Views:	8 
Size:	43.4 KB 
ID:	41789Click image for larger version. 

Name:	date.JPG 
Views:	8 
Size:	43.4 KB 
ID:	41789

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Try
    LValue = Format(Date(), "yymm")

  3. #3
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110
    I've solved it...

  4. #4
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110
    Quote Originally Posted by davegri View Post
    Try
    LValue = Format(Date(), "yymm")
    Hi Dave,

    Thx for the info. But i've tried it. Its not working .

    Code:
    Private Sub Form_Load()
    
    Dim LValue As String
    Dim A As Date
    
    
    A = Now()
    
    
    'MsgBox (A)
    
    
    LValue = Format(A, "YYMM")
    
    
    'MsgBox (LValue)
    
    
    'Me.txtscar = Nz(DMax(" SCAR ", "F1NCtbl", SCAR = LValue), 0) + 1
     Forms!F1NCform.txtsequence = Format(Nz(DMax("Sequence", "F1NCtbl", "YYMM = '" & LValue & "'"), 0) + 1, "00")
    
    
    Forms!F1NCform.txtscar = "ANC" & LValue & Me.txtsequence
    
    
    'Me.txtsequence = Nz(DMax("Sequence", "F1NCtbl", "YYMM = '" & LValue & "'"), 0) + 1
    
    
    Me.Dirty = False
    
    
    End Sub

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

Similar Threads

  1. Or Is NULL in date peramiters
    By Homegrownandy in forum Queries
    Replies: 4
    Last Post: 02-17-2017, 06:20 AM
  2. Replies: 2
    Last Post: 09-23-2014, 11:32 AM
  3. Finding the Max Date and Null Values if Null
    By SpdRacerX in forum Queries
    Replies: 1
    Last Post: 02-03-2012, 06:29 AM
  4. Conditional format for Null date
    By azaz in forum Forms
    Replies: 1
    Last Post: 12-27-2010, 03:11 AM
  5. detecting a null date
    By tedpottel in forum Queries
    Replies: 3
    Last Post: 03-02-2010, 01:45 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