473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to add restriction that field is empty.

I have button and added the command that places a date and some stripes
in the Notes-field. That works fine. If there is already some text, it
places the date at a next line:

Private Sub Command80_Click()
Me.Notes = Me.Notes & vbCrLf & Format(Date, "dd-mm-yyyy") & " ------ "
Notes.SetFocus
Notes.SelStart = Len(Notes.Value)
End Sub

However, when the Notes field is empty it still places the date at the
next line, leaving the first line empty. How to have the date placed in
the upper-left corner (the start of the field) when it is empty.

Is it something like:

If Me.Notes.Value = 1 Then .... ?
Bart
Access 2003

Feb 19 '06 #1
2 1519
"AA Arens" <ba***********@gmail.com> wrote in
news:11**********************@o13g2000cwo.googlegr oups.com:
I have button and added the command that places a date and
some stripes in the Notes-field. That works fine. If there is
already some text, it places the date at a next line:

Private Sub Command80_Click()
Me.Notes = Me.Notes & vbCrLf & Format(Date, "dd-mm-yyyy") & "
------ " Notes.SetFocus
Notes.SelStart = Len(Notes.Value)
End Sub

However, when the Notes field is empty it still places the
date at the next line, leaving the first line empty. How to
have the date placed in the upper-left corner (the start of
the field) when it is empty.

Is it something like:

If Me.Notes.Value = 1 Then .... ?
Bart
Access 2003

If len(me.notes)> 0 then
me.notes = me.notes & vbCrLf
end if
me.notes = me.notes & ....

--
Bob Quintal

PA is y I've altered my email address.
Feb 19 '06 #2
Bob Quintal <rq******@sympatico.ca> wrote in
news:Xn**********************@207.35.177.135:
"AA Arens" <ba***********@gmail.com> wrote in
news:11**********************@o13g2000cwo.googlegr oups.com:
I have button and added the command that places a date and
some stripes in the Notes-field. That works fine. If there is
already some text, it places the date at a next line:

Private Sub Command80_Click()
Me.Notes = Me.Notes & vbCrLf & Format(Date, "dd-mm-yyyy") & " ------ " Notes.SetFocus
Notes.SelStart = Len(Notes.Value)
End Sub

However, when the Notes field is empty it still places the
date at the next line, leaving the first line empty. How to
have the date placed in the upper-left corner (the start of
the field) when it is empty.

Is it something like:

If Me.Notes.Value = 1 Then .... ?
Bart
Access 2003

If len(me.notes)> 0 then
me.notes = me.notes & vbCrLf
end if
me.notes = me.notes & ....

Access may choke on the code above.

If len(me.notes & "") > 0 then
will not.
--
Bob Quintal

PA is y I've altered my email address.
Feb 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steven Hilton | last post by:
I am experiencing odd behavior, and I'm hoping someone can explain why it is behaving this way, and how to get around it... When I update a row in a table with a field's data set to NULL, but...
0
by: Steven Hilton | last post by:
I am experiencing odd behavior, and I'm hoping someone can explain why it is behaving this way, and how to get around it... When I update a row in a table with a field's data set to NULL, but...
0
by: Deep Purple | last post by:
I started with the following error... ------------------------------------------------------- An error occured while loading the schema with TargetNamespace 'http://www.w3.org/2001/XMLSchema'...
0
by: mseeger | last post by:
My concrete problem is this (it is a bit special, but there may be other instances of it): I'd like to create a class for vectors (say: Vector), exporting math. methods, say v.foo(...). I'd like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.