Syntax Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry for the re-post, but I think no one wants to deal with DTpicker q's
because it sucks. But I would appreciate any input into the following:

With the below I'm checking the qryVisitList to see if there are records. If
no records exist, I want the date picker to display today's date, but not
initiate a new record. What happens now is if I go to a patient who has no
visit date, the date form the previous patient's visit is displayed by the
date picker rather than today's date. So, no visits, date picker display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
If you're trying to display today's date, what are you setting the control's
Format property?
 
I want to display today's date when the fldVisitDate is Null (pt has no prior
visits), but I don't want the field to be populated until the user clicks on
today's date. Currently, when I go to a pt without a prior visit, the date
picker displays (not enters) the visit date of the prior pt. So I want the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

Douglas J. Steele said:
If you're trying to display today's date, what are you setting the control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
Sorry for the re-post, but I think no one wants to deal with DTpicker q's
because it sucks. But I would appreciate any input into the following:

With the below I'm checking the qryVisitList to see if there are records.
If
no records exist, I want the date picker to display today's date, but not
initiate a new record. What happens now is if I go to a patient who has no
visit date, the date form the previous patient's visit is displayed by the
date picker rather than today's date. So, no visits, date picker display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
But Format dictates how it displays, not what it displays.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
I want to display today's date when the fldVisitDate is Null (pt has no
prior
visits), but I don't want the field to be populated until the user clicks
on
today's date. Currently, when I go to a pt without a prior visit, the date
picker displays (not enters) the visit date of the prior pt. So I want the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

Douglas J. Steele said:
If you're trying to display today's date, what are you setting the
control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
Sorry for the re-post, but I think no one wants to deal with DTpicker
q's
because it sucks. But I would appreciate any input into the following:

With the below I'm checking the qryVisitList to see if there are
records.
If
no records exist, I want the date picker to display today's date, but
not
initiate a new record. What happens now is if I go to a patient who has
no
visit date, the date form the previous patient's visit is displayed by
the
date picker rather than today's date. So, no visits, date picker
display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
Ok, Could you give me any help with what I want to do. Thanks, rob

Douglas J. Steele said:
But Format dictates how it displays, not what it displays.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
I want to display today's date when the fldVisitDate is Null (pt has no
prior
visits), but I don't want the field to be populated until the user clicks
on
today's date. Currently, when I go to a pt without a prior visit, the date
picker displays (not enters) the visit date of the prior pt. So I want the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

Douglas J. Steele said:
If you're trying to display today's date, what are you setting the
control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sorry for the re-post, but I think no one wants to deal with DTpicker
q's
because it sucks. But I would appreciate any input into the following:

With the below I'm checking the qryVisitList to see if there are
records.
If
no records exist, I want the date picker to display today's date, but
not
initiate a new record. What happens now is if I go to a patient who has
no
visit date, the date form the previous patient's visit is displayed by
the
date picker rather than today's date. So, no visits, date picker
display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
OK Doug, but could you help me with the problem I have described below? It
would be much appreciated. Thanks, rob

Douglas J. Steele said:
But Format dictates how it displays, not what it displays.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
I want to display today's date when the fldVisitDate is Null (pt has no
prior
visits), but I don't want the field to be populated until the user clicks
on
today's date. Currently, when I go to a pt without a prior visit, the date
picker displays (not enters) the visit date of the prior pt. So I want the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

Douglas J. Steele said:
If you're trying to display today's date, what are you setting the
control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sorry for the re-post, but I think no one wants to deal with DTpicker
q's
because it sucks. But I would appreciate any input into the following:

With the below I'm checking the qryVisitList to see if there are
records.
If
no records exist, I want the date picker to display today's date, but
not
initiate a new record. What happens now is if I go to a patient who has
no
visit date, the date form the previous patient's visit is displayed by
the
date picker rather than today's date. So, no visits, date picker
display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
To be honest, I never use calendar controls (I prefer what Stephen Lebans
has at http://www.lebans.com/monthcalendar.htm), but I'd assume it should
be:

Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then
frmVisitNewEdit.Form!DTPicker7.Value = MyDate
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
OK Doug, but could you help me with the problem I have described below? It
would be much appreciated. Thanks, rob

Douglas J. Steele said:
But Format dictates how it displays, not what it displays.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
I want to display today's date when the fldVisitDate is Null (pt has no
prior
visits), but I don't want the field to be populated until the user
clicks
on
today's date. Currently, when I go to a pt without a prior visit, the
date
picker displays (not enters) the visit date of the prior pt. So I want
the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

:

If you're trying to display today's date, what are you setting the
control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sorry for the re-post, but I think no one wants to deal with
DTpicker
q's
because it sucks. But I would appreciate any input into the
following:

With the below I'm checking the qryVisitList to see if there are
records.
If
no records exist, I want the date picker to display today's date,
but
not
initiate a new record. What happens now is if I go to a patient who
has
no
visit date, the date form the previous patient's visit is displayed
by
the
date picker rather than today's date. So, no visits, date picker
display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
Thanks Doug for your help. Your solution gets the date picker to add todays
date to the field, I just want it to display today's date. To me, my app
looks unproffesional when the user clicks on a pt record that has no visits
and the visit date form the prior pt displays in the date picker. If you have
any other ideas I'd be glad to hear them. Thanks, rob

Douglas J. Steele said:
To be honest, I never use calendar controls (I prefer what Stephen Lebans
has at http://www.lebans.com/monthcalendar.htm), but I'd assume it should
be:

Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then
frmVisitNewEdit.Form!DTPicker7.Value = MyDate
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
OK Doug, but could you help me with the problem I have described below? It
would be much appreciated. Thanks, rob

Douglas J. Steele said:
But Format dictates how it displays, not what it displays.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I want to display today's date when the fldVisitDate is Null (pt has no
prior
visits), but I don't want the field to be populated until the user
clicks
on
today's date. Currently, when I go to a pt without a prior visit, the
date
picker displays (not enters) the visit date of the prior pt. So I want
the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

:

If you're trying to display today's date, what are you setting the
control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sorry for the re-post, but I think no one wants to deal with
DTpicker
q's
because it sucks. But I would appreciate any input into the
following:

With the below I'm checking the qryVisitList to see if there are
records.
If
no records exist, I want the date picker to display today's date,
but
not
initiate a new record. What happens now is if I go to a patient who
has
no
visit date, the date form the previous patient's visit is displayed
by
the
date picker rather than today's date. So, no visits, date picker
display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
If it's a bound control, you can't set it to a value without having that
value put into the database.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


RobUCSD said:
Thanks Doug for your help. Your solution gets the date picker to add
todays
date to the field, I just want it to display today's date. To me, my app
looks unproffesional when the user clicks on a pt record that has no
visits
and the visit date form the prior pt displays in the date picker. If you
have
any other ideas I'd be glad to hear them. Thanks, rob

Douglas J. Steele said:
To be honest, I never use calendar controls (I prefer what Stephen Lebans
has at http://www.lebans.com/monthcalendar.htm), but I'd assume it should
be:

Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then
frmVisitNewEdit.Form!DTPicker7.Value = MyDate
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RobUCSD said:
OK Doug, but could you help me with the problem I have described below?
It
would be much appreciated. Thanks, rob

:

But Format dictates how it displays, not what it displays.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I want to display today's date when the fldVisitDate is Null (pt has
no
prior
visits), but I don't want the field to be populated until the user
clicks
on
today's date. Currently, when I go to a pt without a prior visit,
the
date
picker displays (not enters) the visit date of the prior pt. So I
want
the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

:

If you're trying to display today's date, what are you setting the
control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sorry for the re-post, but I think no one wants to deal with
DTpicker
q's
because it sucks. But I would appreciate any input into the
following:

With the below I'm checking the qryVisitList to see if there are
records.
If
no records exist, I want the date picker to display today's date,
but
not
initiate a new record. What happens now is if I go to a patient
who
has
no
visit date, the date form the previous patient's visit is
displayed
by
the
date picker rather than today's date. So, no visits, date picker
display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
Again, thanks Doug. As I've heard in this forum many times there is more
than one way to skin a cat. I made the dtpicker control invisible when a pt
has no visit history. Then I placed a rectangle, colored white over the date
field in design view. So now when a user goes to a pt with no records he/she
sees a psuedo blank field where the date picker would be. When the user
clicks on the New Visit button, date picker is made visible and defaults to
todays date. Problem solved.

Thanks for all your help. I'm learning, slowly, but I'm learning.

Thanks, Rob

Douglas J. Steele said:
If it's a bound control, you can't set it to a value without having that
value put into the database.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


RobUCSD said:
Thanks Doug for your help. Your solution gets the date picker to add
todays
date to the field, I just want it to display today's date. To me, my app
looks unproffesional when the user clicks on a pt record that has no
visits
and the visit date form the prior pt displays in the date picker. If you
have
any other ideas I'd be glad to hear them. Thanks, rob

Douglas J. Steele said:
To be honest, I never use calendar controls (I prefer what Stephen Lebans
has at http://www.lebans.com/monthcalendar.htm), but I'd assume it should
be:

Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then
frmVisitNewEdit.Form!DTPicker7.Value = MyDate
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


OK Doug, but could you help me with the problem I have described below?
It
would be much appreciated. Thanks, rob

:

But Format dictates how it displays, not what it displays.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I want to display today's date when the fldVisitDate is Null (pt has
no
prior
visits), but I don't want the field to be populated until the user
clicks
on
today's date. Currently, when I go to a pt without a prior visit,
the
date
picker displays (not enters) the visit date of the prior pt. So I
want
the
dtpicker to display today for those who have no visits.

Thanks Doug, I appreciate your time.
Rob

:

If you're trying to display today's date, what are you setting the
control's
Format property?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sorry for the re-post, but I think no one wants to deal with
DTpicker
q's
because it sucks. But I would appreciate any input into the
following:

With the below I'm checking the qryVisitList to see if there are
records.
If
no records exist, I want the date picker to display today's date,
but
not
initiate a new record. What happens now is if I go to a patient
who
has
no
visit date, the date form the previous patient's visit is
displayed
by
the
date picker rather than today's date. So, no visits, date picker
display
today's date only, don't initiate a new record.

Hope this is clear, as always your help is greatly appreciated.
Thanks, Rob


Dim MyDate As Date

MyDate = Date

If (DCount("*", "[qryVisitList]") < 1) Then

frmVisitNewEdit.Form!DTPicker7.Format = "@;" & MyDate

End If
 
Back
Top