Welcome to SPN

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

Sign Up Now!

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
    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
    Entering into Sikhism: Questions on Reht Maryada. Blogs Oct 22, 2015
    A question about kes/hair? Blogs Oct 21, 2015

  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
    >
     

Share This Page