If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
Home Version Access
That doesn't work because it's looking for the literal string [Me.Combobox]
anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#22
|
|||
|
|||
Home Version Access
Getting closer.... at least this time it did open the form, but it was blank...
strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#23
|
|||
|
|||
Home Version Access
Sorry, my typo.
strwhere = strwhere & "[queryobject.subject] LIKE ""*" & Me.Combobox & "*""" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#24
|
|||
|
|||
Home Version Access
Even better, it pulls some data onto the form, but not all, and a column of
information from another field doesnt show up on the form like it used to when executing that statement "accessdesigner" wrote: Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#25
|
|||
|
|||
Home Version Access
Something else is wrong because its not reading it correctly, it locks up
after opening the form but it is not reading new data if i enter new data into the combo box "Douglas J. Steele" wrote: Sorry, my typo. strwhere = strwhere & "[queryobject.subject] LIKE ""*" & Me.Combobox & "*""" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#26
|
|||
|
|||
Home Version Access
Don't understand what you mean by "reading new data". Once you've set the
criteria, it's set: changing the combo box won't be reflected unless you select a new value from the combo box. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Something else is wrong because its not reading it correctly, it locks up after opening the form but it is not reading new data if i enter new data into the combo box "Douglas J. Steele" wrote: Sorry, my typo. strwhere = strwhere & "[queryobject.subject] LIKE ""*" & Me.Combobox & "*""" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#27
|
|||
|
|||
Home Version Access
exactly.... and i meant "textbox" to where i type in a value to be searched,
versus pulling from a predefined list... it wont work correctly.... every time i retry... sometimes the form comes up blank, sometimes it has one or two records that did include the search word, then sometimes it locks up completely, and contain wrong records... "Douglas J. Steele" wrote: Don't understand what you mean by "reading new data". Once you've set the criteria, it's set: changing the combo box won't be reflected unless you select a new value from the combo box. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Something else is wrong because its not reading it correctly, it locks up after opening the form but it is not reading new data if i enter new data into the combo box "Douglas J. Steele" wrote: Sorry, my typo. strwhere = strwhere & "[queryobject.subject] LIKE ""*" & Me.Combobox & "*""" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#28
|
|||
|
|||
Home Version Access
the statement wont work as a stand alone, but it will work if i include an
additional criteria combo box with that one, ... like subject and date, but the subject criteria wont work by itself "accessdesigner" wrote: exactly.... and i meant "textbox" to where i type in a value to be searched, versus pulling from a predefined list... it wont work correctly.... every time i retry... sometimes the form comes up blank, sometimes it has one or two records that did include the search word, then sometimes it locks up completely, and contain wrong records... "Douglas J. Steele" wrote: Don't understand what you mean by "reading new data". Once you've set the criteria, it's set: changing the combo box won't be reflected unless you select a new value from the combo box. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Something else is wrong because its not reading it correctly, it locks up after opening the form but it is not reading new data if i enter new data into the combo box "Douglas J. Steele" wrote: Sorry, my typo. strwhere = strwhere & "[queryobject.subject] LIKE ""*" & Me.Combobox & "*""" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#29
|
|||
|
|||
Home Version Access
Show your code (making sure you indicate how it's being invoked).
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... the statement wont work as a stand alone, but it will work if i include an additional criteria combo box with that one, ... like subject and date, but the subject criteria wont work by itself "accessdesigner" wrote: exactly.... and i meant "textbox" to where i type in a value to be searched, versus pulling from a predefined list... it wont work correctly.... every time i retry... sometimes the form comes up blank, sometimes it has one or two records that did include the search word, then sometimes it locks up completely, and contain wrong records... "Douglas J. Steele" wrote: Don't understand what you mean by "reading new data". Once you've set the criteria, it's set: changing the combo box won't be reflected unless you select a new value from the combo box. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Something else is wrong because its not reading it correctly, it locks up after opening the form but it is not reading new data if i enter new data into the combo box "Douglas J. Steele" wrote: Sorry, my typo. strwhere = strwhere & "[queryobject.subject] LIKE ""*" & Me.Combobox & "*""" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
#30
|
|||
|
|||
Home Version Access
when i f9 and f8 to step through the program, it wont turn yellow.....
"Douglas J. Steele" wrote: Show your code (making sure you indicate how it's being invoked). -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... the statement wont work as a stand alone, but it will work if i include an additional criteria combo box with that one, ... like subject and date, but the subject criteria wont work by itself "accessdesigner" wrote: exactly.... and i meant "textbox" to where i type in a value to be searched, versus pulling from a predefined list... it wont work correctly.... every time i retry... sometimes the form comes up blank, sometimes it has one or two records that did include the search word, then sometimes it locks up completely, and contain wrong records... "Douglas J. Steele" wrote: Don't understand what you mean by "reading new data". Once you've set the criteria, it's set: changing the combo box won't be reflected unless you select a new value from the combo box. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Something else is wrong because its not reading it correctly, it locks up after opening the form but it is not reading new data if i enter new data into the combo box "Douglas J. Steele" wrote: Sorry, my typo. strwhere = strwhere & "[queryobject.subject] LIKE ""*" & Me.Combobox & "*""" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... Getting closer.... at least this time it did open the form, but it was blank... strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" i replaced *Me.Combobox with ... &Me.Combobox but it did not read any data, it bypassed the statement completely and just opened the form.... but thats a start in the right direction, because at first my statement locked the program and the form did not open at all... "Douglas J. Steele" wrote: That doesn't work because it's looking for the literal string [Me.Combobox] anywhere in your subject field. Assuming you want the value that's currently selected in Combobox, you need to use: strwhere = strwhere & "[queryobject.subject] LIKE '*" * Me.Combobox & "*'" Note the inclusion of single quotes in there. Exagerated for clarity, it's strwhere = strwhere & "[queryobject.subject] LIKE ' * " * Me.Combobox & " * ' " If it's possible that what's in Combobox is going to include apostrophes, use the following instead: strwhere = strwhere & "[queryobject.subject] LIKE ""*" * Me.Combobox & "*""" That's strwhere = strwhere & "[queryobject.subject] LIKE " " * " * Me.Combobox & " * " " " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... I will try that when I get back home.... I was trying to practice on my work version, which still doesnt work: strwhere = strwhere & "[queryobject.subject]LIKE ''*[Me.Combobox]*" it still wont work..... "John Vinson" wrote: On Sun, 26 Nov 2006 09:31:02 -0800, accessdesigner wrote: ty... ( need you all on speed dial.... lol) my combobox is connected to : SELECT Names.Name FROM [Names] ORDER BY [Name]; (thats a table where my list names scroll down from the combobox The Query: NameThings .....is only connected to my Report The word Name is a bad Name to Name a field or a control, since both tables and controls have a Name property already! Try changing the table definition so that you're using a nonreserved term in place of Name - or at the very least bracket it. The difference between the home and work versions *MIGHT* be because one of them has Name Autocorrect set in the database's Options, and the other doesn't. IN my experience this misfeature should be turned OFF. Perhaps you could post the complete SQL of the NameThings query, with some indication of the datatypes of the table fields. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|