Welcome to SPN

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

Sign Up Now!

filter

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

Tags:
  1. Chey

    Chey
    Expand Collapse
    Guest

    Private Sub Combo87_AfterUpdate()
    Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    Me.FilterOn = True
    End Sub
    This is what I have in a combo box 87, I used to have this as a text but
    had to change it to a date. now it does not work. The error message I get
    is Run time error 200
    You canceled the previous operation. I have not changed any of the coding
    at all just turned a text into a date field. Now what?

    Thanks
    Chey
     
  2. Loading...

    Similar Threads Forum Date
    General Filter Test Hard Talk May 20, 2008

  3. default105

    default105
    Expand Collapse
    Guest

    Try
    Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"

    "Chey" wrote:

    > Private Sub Combo87_AfterUpdate()
    > Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > Me.FilterOn = True
    > End Sub
    > This is what I have in a combo box 87, I used to have this as a text but
    > had to change it to a date. now it does not work. The error message I get
    > is Run time error 200
    > You canceled the previous operation. I have not changed any of the coding
    > at all just turned a text into a date field. Now what?
    >
    > Thanks
    > Chey
     
  4. Chey

    Chey
    Expand Collapse
    Guest

    it doesn't do any thing. When I choose the month it is suppose to filter
    everything in the form with that month.

    "default105" wrote:

    > Try
    > Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"
    >
    > "Chey" wrote:
    >
    > > Private Sub Combo87_AfterUpdate()
    > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > > Me.FilterOn = True
    > > End Sub
    > > This is what I have in a combo box 87, I used to have this as a text but
    > > had to change it to a date. now it does not work. The error message I get
    > > is Run time error 200
    > > You canceled the previous operation. I have not changed any of the coding
    > > at all just turned a text into a date field. Now what?
    > >
    > > Thanks
    > > Chey
     
  5. default105

    default105
    Expand Collapse
    Guest

    So are you saying that you have text format in one and a date format in
    another?


    "Chey" wrote:

    > it doesn't do any thing. When I choose the month it is suppose to filter
    > everything in the form with that month.
    >
    > "default105" wrote:
    >
    > > Try
    > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"
    > >
    > > "Chey" wrote:
    > >
    > > > Private Sub Combo87_AfterUpdate()
    > > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > > > Me.FilterOn = True
    > > > End Sub
    > > > This is what I have in a combo box 87, I used to have this as a text but
    > > > had to change it to a date. now it does not work. The error message I get
    > > > is Run time error 200
    > > > You canceled the previous operation. I have not changed any of the coding
    > > > at all just turned a text into a date field. Now what?
    > > >
    > > > Thanks
    > > > Chey
     
  6. Chey

    Chey
    Expand Collapse
    Guest

    no I changed everything over to date. However in the combo box, i have it
    pulling from a table, and then i have unique value selected. So then on my
    form I have the combo box and then the field it is suppose to filter with.
    Everything is out of the same table. and also the same field. Everything
    matches. When I select the month it just blinks and stays the same. After I
    choose my month i then choose a provider number. The provider number works
    okay, just not the month.
    Under where I choose the vendor number I have

    Private Sub cboMoveto_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[tblChild Care Providers_Vendor Number] = '" &
    Me![CboMoveTo] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark


    End Sub

    Thanks for your time.

    "default105" wrote:

    > So are you saying that you have text format in one and a date format in
    > another?
    >
    >
    > "Chey" wrote:
    >
    > > it doesn't do any thing. When I choose the month it is suppose to filter
    > > everything in the form with that month.
    > >
    > > "default105" wrote:
    > >
    > > > Try
    > > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"
    > > >
    > > > "Chey" wrote:
    > > >
    > > > > Private Sub Combo87_AfterUpdate()
    > > > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
    > > > > Me.FilterOn = True
    > > > > End Sub
    > > > > This is what I have in a combo box 87, I used to have this as a text but
    > > > > had to change it to a date. now it does not work. The error message I get
    > > > > is Run time error 200
    > > > > You canceled the previous operation. I have not changed any of the coding
    > > > > at all just turned a text into a date field. Now what?
    > > > >
    > > > > Thanks
    > > > > Chey
     
  7. default105

    default105
    Expand Collapse
    Guest

    Ok, bear with me hear, I had a similar problem with a combobox when applying
    a filter before. What I found is that when you create a combobox the wizard
    asks to hide the key column. In the SQL statement the keyID field is first
    but the bound column is 1 but the value I was pulling is actually the keyID.
    I had to change my row source so the keyID was after the display value and
    then change the column widths to ie 1";0" so the keyID is hide again.

    Does this help?

    "Chey" wrote:

    > no I changed everything over to date. However in the combo box, i have it
    > pulling from a table, and then i have unique value selected. So then on my
    > form I have the combo box and then the field it is suppose to filter with.
    > Everything is out of the same table. and also the same field. Everything
    > matches. When I select the month it just blinks and stays the same. After I
    > choose my month i then choose a provider number. The provider number works
    > okay, just not the month.
    > Under where I choose the vendor number I have
    >
    > Private Sub cboMoveto_AfterUpdate()
    > ' Find the record that matches the control.
    > Dim rs As Object
    >
    > Set rs = Me.Recordset.Clone
    > rs.FindFirst "[tblChild Care Providers_Vendor Number] = '" &
    > Me![CboMoveTo] & "'"
    > If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    >
    >
    > End Sub
    >
    > Thanks for your time.
    >
    > "default105" wrote:
    >
    > > So are you saying that you have text format in one and a date format in
    > > another?
    > >
    > >
    > > "Chey" wrote:
    > >
    > > > it doesn't do any thing. When I choose the month it is suppose to filter
    > > > everything in the form with that month.
    > > >
    > > > "default105" wrote:
    > > >
    > > > > Try
    > > > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"
    > > > >
    > > > > "Chey" wrote:
     
  8. Chey

    Chey
    Expand Collapse
    Guest

    okay that didn't make any sense. Why would this have worked before with a
    text but does not work with a date? I didn't use the wizard with the combo
    box. I also have the combo box in the form header, along with the vendor
    number combo box.

    "default105" wrote:

    > Ok, bear with me hear, I had a similar problem with a combobox when applying
    > a filter before. What I found is that when you create a combobox the wizard
    > asks to hide the key column. In the SQL statement the keyID field is first
    > but the bound column is 1 but the value I was pulling is actually the keyID.
    > I had to change my row source so the keyID was after the display value and
    > then change the column widths to ie 1";0" so the keyID is hide again.
    >
    > Does this help?
    >
    > "Chey" wrote:
    >
    > > no I changed everything over to date. However in the combo box, i have it
    > > pulling from a table, and then i have unique value selected. So then on my
    > > form I have the combo box and then the field it is suppose to filter with.
    > > Everything is out of the same table. and also the same field. Everything
    > > matches. When I select the month it just blinks and stays the same. After I
    > > choose my month i then choose a provider number. The provider number works
    > > okay, just not the month.
    > > Under where I choose the vendor number I have
    > >
    > > Private Sub cboMoveto_AfterUpdate()
    > > ' Find the record that matches the control.
    > > Dim rs As Object
    > >
    > > Set rs = Me.Recordset.Clone
    > > rs.FindFirst "[tblChild Care Providers_Vendor Number] = '" &
    > > Me![CboMoveTo] & "'"
    > > If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    > >
    > >
    > > End Sub
    > >
    > > Thanks for your time.
    > >
    > > "default105" wrote:
    > >
    > > > So are you saying that you have text format in one and a date format in
    > > > another?
    > > >
    > > >
    > > > "Chey" wrote:
    > > >
    > > > > it doesn't do any thing. When I choose the month it is suppose to filter
    > > > > everything in the form with that month.
    > > > >
    > > > > "default105" wrote:
    > > > >
    > > > > > Try
    > > > > > Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"
    > > > > >
    > > > > > "Chey" wrote:

    >
     
  9. default105

    default105
    Expand Collapse
    Guest

    First off, what I posted does make sense if you used a wizard but as I see
    this is not your situations. I say that it is a formatting issue because as
    you said it was text before and now it is date. Probably is trying to
    compare two different formats. I will turn this over to someone else. I
    thought it might have only been a error with the combo box reference. The
    only other thing I can possibly think as a try is to use

    "[tblGrantCompletion.theMonth] = " & [Combo87]

    "Chey" wrote:

    > okay that didn't make any sense. Why would this have worked before with a
    > text but does not work with a date? I didn't use the wizard with the combo
    > box. I also have the combo box in the form header, along with the vendor
    > number combo box.
    >
     
  10. Chey

    Chey
    Expand Collapse
    Guest

    Thanks, that will be great.

    "default105" wrote:

    > First off, what I posted does make sense if you used a wizard but as I see
    > this is not your situations. I say that it is a formatting issue because as
    > you said it was text before and now it is date. Probably is trying to
    > compare two different formats. I will turn this over to someone else. I
    > thought it might have only been a error with the combo box reference. The
    > only other thing I can possibly think as a try is to use
    >
    > "[tblGrantCompletion.theMonth] = " & [Combo87]
    >
    > "Chey" wrote:
    >
    > > okay that didn't make any sense. Why would this have worked before with a
    > > text but does not work with a date? I didn't use the wizard with the combo
    > > box. I also have the combo box in the form header, along with the vendor
    > > number combo box.
    > >

    >
     

Share This Page