General discussion


Access 2000 Date Function

By MRA2 ·
All I wanted to do on a FORM was:

If the date is null (Not entered) then enter the System Date.

Here is ny code which for some reason WILL NOT recognize the Date Function...

Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

If IsNull([Forms]![Form1]![Dates subform]![DateServ]) Then
'[Forms]![Form1]![Dates subform]![DateServ] = #1/1/2222# ?This Works!
[Forms]![Form1]![Dates subform]![DateServ] = Date ' Does not recognize Date Function

End If

'Prevent Orphan (Non-Viewable)Record
? This section works
If IsNull([Forms]![Form1]![Notes Subform1]![Notes]) Then
[Forms]![Form1]![Notes Subform1]![Notes].Value = "None"
'[Forms]![Form1]![Notes Subform1]![Notes].Value = Null ' This works
End If

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
MsgBox "NEW Record Saved!"

Exit Sub

MsgBox Err.Description
Resume Exit_Command12_Click

End Sub

Can anyone explain why this does NOT work and how I can do this....


This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by john.a.wills In reply to Access 2000 Date Function

try date()

Collapse -

by MRA2 In reply to

I tried Date () and when you hit enter you get date

Collapse -

by Tony Hopkinson In reply to Access 2000 Date Function

Wild stab in the dark try

Collapse -

by Winterfrost In reply to Access 2000 Date Function

The syntax is definitely "Date()" -- make sure there's no spaces.

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums