Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95
      Become a Supporter    ::   Make a Contribution   

Question on Code

Discussion in 'Information Technology' started by Chey, Jul 28, 2006.

Tags:
  1. Chey

    Chey
    Expand Collapse
    Guest

    I have this code currently in a text field
    Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    Me.FilterOn = True
    However I would like it to be for a Date/Time field. Is there anything in
    this code that says its for text or would I be okay pasting this for a
    date/time field. I do have to change my field names though.
    Thanks
    Chey
     
  2. Loading...

    Similar Threads Forum Date
    Anyone Have Any Unanswered Questions On Sikhi Or God? Sikh Sikhi Sikhism Jan 7, 2017
    Question About Translations Questions and Answers Dec 20, 2016
    Question About GGS Questions and Answers Aug 28, 2016
    Marriage And Discrimination Related Questions Blogs Mar 21, 2016
    Sikhi Questioning Faith Sikh Sikhi Sikhism Mar 3, 2016

  3. Jeff Boyce

    Jeff Boyce
    Expand Collapse
    Guest

    Chey

    If you are using a Date/Time data type field, you'll need to use the
    Date/Time delimiter instead (use the # symbol, not the quote, on either
    side).

    Are you quite confident that the field is correctly typed as Date/Time?

    Regards

    Jeff Boyce
    Microsoft Office/Access MVP


    "Chey" <Chey@discussions.microsoft.com> wrote in message
    news:A9BF0367-B8D3-4064-9253-99AAC0392967@microsoft.com...
    >I have this code currently in a text field
    > Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > Me.FilterOn = True
    > However I would like it to be for a Date/Time field. Is there anything in
    > this code that says its for text or would I be okay pasting this for a
    > date/time field. I do have to change my field names though.
    > Thanks
    > Chey
     
  4. Chey

    Chey
    Expand Collapse
    Guest

    oh well of course not. In my table I have it as Date/Time. This comes out
    of 2 tables. They both are date Time. I also have it formated as mmmm yyyy
    so it looks like May 2006. That is how I want it. I just want to make sure
    that I am not typing a text code into a date field.
    Thanks

    "Jeff Boyce" wrote:

    > Chey
    >
    > If you are using a Date/Time data type field, you'll need to use the
    > Date/Time delimiter instead (use the # symbol, not the quote, on either
    > side).
    >
    > Are you quite confident that the field is correctly typed as Date/Time?
    >
    > Regards
    >
    > Jeff Boyce
    > Microsoft Office/Access MVP
    >
    >
    > "Chey" <Chey@discussions.microsoft.com> wrote in message
    > news:A9BF0367-B8D3-4064-9253-99AAC0392967@microsoft.com...
    > >I have this code currently in a text field
    > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > > Me.FilterOn = True
    > > However I would like it to be for a Date/Time field. Is there anything in
    > > this code that says its for text or would I be okay pasting this for a
    > > date/time field. I do have to change my field names though.
    > > Thanks
    > > Chey

    >
    >
    >
     
  5. Chey

    Chey
    Expand Collapse
    Guest

    So I changed the quotes to # but I don't think I did all the right ones.
    This is what I did.
    Me.Filter = #[TheMonth2] = '" & Me.Combo163 & "'#
    Me.FilterOn = True
    Do I need to put # everywhere there is "?

    "Jeff Boyce" wrote:

    > Chey
    >
    > If you are using a Date/Time data type field, you'll need to use the
    > Date/Time delimiter instead (use the # symbol, not the quote, on either
    > side).
    >
    > Are you quite confident that the field is correctly typed as Date/Time?
    >
    > Regards
    >
    > Jeff Boyce
    > Microsoft Office/Access MVP
    >
    >
    > "Chey" <Chey@discussions.microsoft.com> wrote in message
    > news:A9BF0367-B8D3-4064-9253-99AAC0392967@microsoft.com...
    > >I have this code currently in a text field
    > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > > Me.FilterOn = True
    > > However I would like it to be for a Date/Time field. Is there anything in
    > > this code that says its for text or would I be okay pasting this for a
    > > date/time field. I do have to change my field names though.
    > > Thanks
    > > Chey

    >
    >
    >
     
  6. fredg

    fredg
    Expand Collapse
    Guest

    On Fri, 16 Jun 2006 10:56:02 -0700, Chey wrote:

    > So I changed the quotes to # but I don't think I did all the right ones.
    > This is what I did.
    > Me.Filter = #[TheMonth2] = '" & Me.Combo163 & "'#
    > Me.FilterOn = True
    > Do I need to put # everywhere there is "?
    >
    > "Jeff Boyce" wrote:
    >
    >> Chey
    >>
    >> If you are using a Date/Time data type field, you'll need to use the
    >> Date/Time delimiter instead (use the # symbol, not the quote, on either
    >> side).
    >>
    >> Are you quite confident that the field is correctly typed as Date/Time?
    >>
    >> Regards
    >>
    >> Jeff Boyce
    >> Microsoft Office/Access MVP
    >>
    >> "Chey" <Chey@discussions.microsoft.com> wrote in message
    >> news:A9BF0367-B8D3-4064-9253-99AAC0392967@microsoft.com...
    >>>I have this code currently in a text field
    >>> Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    >>> Me.FilterOn = True
    >>> However I would like it to be for a Date/Time field. Is there anything in
    >>> this code that says its for text or would I be okay pasting this for a
    >>> date/time field. I do have to change my field names though.
    >>> Thanks
    >>> Chey

    >>
    >>


    Me.Filter = "[TheMonth2] = #" & Me.Combo163 & "#"
    Me.FilterOn = True

    The above assumes [TheMonth2] contains a valid date (Month, Day,
    Year), as does Combo153.

    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail
     
  7. Chey

    Chey
    Expand Collapse
    Guest

    Thanks it worked

    "fredg" wrote:

    > On Fri, 16 Jun 2006 10:56:02 -0700, Chey wrote:
    >
    > > So I changed the quotes to # but I don't think I did all the right ones.
    > > This is what I did.
    > > Me.Filter = #[TheMonth2] = '" & Me.Combo163 & "'#
    > > Me.FilterOn = True
    > > Do I need to put # everywhere there is "?
    > >
    > > "Jeff Boyce" wrote:
    > >
    > >> Chey
    > >>
    > >> If you are using a Date/Time data type field, you'll need to use the
    > >> Date/Time delimiter instead (use the # symbol, not the quote, on either
    > >> side).
    > >>
    > >> Are you quite confident that the field is correctly typed as Date/Time?
    > >>
    > >> Regards
    > >>
    > >> Jeff Boyce
    > >> Microsoft Office/Access MVP
    > >>
    > >> "Chey" <Chey@discussions.microsoft.com> wrote in message
    > >> news:A9BF0367-B8D3-4064-9253-99AAC0392967@microsoft.com...
    > >>>I have this code currently in a text field
    > >>> Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > >>> Me.FilterOn = True
    > >>> However I would like it to be for a Date/Time field. Is there anything in
    > >>> this code that says its for text or would I be okay pasting this for a
    > >>> date/time field. I do have to change my field names though.
    > >>> Thanks
    > >>> Chey
    > >>
    > >>

    >
    > Me.Filter = "[TheMonth2] = #" & Me.Combo163 & "#"
    > Me.FilterOn = True
    >
    > The above assumes [TheMonth2] contains a valid date (Month, Day,
    > Year), as does Combo153.
    >
    > --
    > Fred
    > Please respond only to this newsgroup.
    > I do not reply to personal e-mail
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page