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 |
#11
|
|||
|
|||
Klatuu -
I tried:
Me.Filter = strwhere & "[filtername.subject] = " & Me!SubjSearch Me.FilterOn = True It worked, except that one of my other fields did not show up on the report... "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#12
|
|||
|
|||
Klatuu -
If this is part of the 8 combo thing you have been working on, it should be
this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#13
|
|||
|
|||
Klatuu -
as technically sound as it looks, (sad face) it wont open the query....
"Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#14
|
|||
|
|||
Klatuu -
What do you mean when you say it wont open the query? Non of the code opens
a query, it passes a where argument to the report. Can you give some more detail on what you mean? "accessdesigner" wrote: as technically sound as it looks, (sad face) it wont open the query.... "Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#15
|
|||
|
|||
Klatuu -
i mean, it wont read the commands correctly, so that the query could
eventually open, it wont get past the commands.... "Klatuu" wrote: What do you mean when you say it wont open the query? Non of the code opens a query, it passes a where argument to the report. Can you give some more detail on what you mean? "accessdesigner" wrote: as technically sound as it looks, (sad face) it wont open the query.... "Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#16
|
|||
|
|||
Klatuu -
Post back with the error number, description, and the line it occurs on.
"accessdesigner" wrote: i mean, it wont read the commands correctly, so that the query could eventually open, it wont get past the commands.... "Klatuu" wrote: What do you mean when you say it wont open the query? Non of the code opens a query, it passes a where argument to the report. Can you give some more detail on what you mean? "accessdesigner" wrote: as technically sound as it looks, (sad face) it wont open the query.... "Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#17
|
|||
|
|||
Klatuu -
i dont know how to do that yet,... but when I click on the ok button.... it
simply closes the form's screen... "Klatuu" wrote: Post back with the error number, description, and the line it occurs on. "accessdesigner" wrote: i mean, it wont read the commands correctly, so that the query could eventually open, it wont get past the commands.... "Klatuu" wrote: What do you mean when you say it wont open the query? Non of the code opens a query, it passes a where argument to the report. Can you give some more detail on what you mean? "accessdesigner" wrote: as technically sound as it looks, (sad face) it wont open the query.... "Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#18
|
|||
|
|||
Klatuu -
To post the code, it is a simple copy from the VBA Editor text into your post.
You really need to learn how to trace the code to solve a problem like this. Open the form in design view. Open the code module. Go to the event where the code is. Put the cursor on the first line of executable code. Then means no Dims, comments, ect. A line that does something. Press F9 - The line will change color. Open the form. Click on the button. Go back to the VBA editor. The line you highlighted earlier will now be hightlighted in yellow. The highlighted line has not yet executed. Press F8 to execute that line of code. The next line that will be executed will now be highlighted. Just follow through the code to see what is happening. "accessdesigner" wrote: i dont know how to do that yet,... but when I click on the ok button.... it simply closes the form's screen... "Klatuu" wrote: Post back with the error number, description, and the line it occurs on. "accessdesigner" wrote: i mean, it wont read the commands correctly, so that the query could eventually open, it wont get past the commands.... "Klatuu" wrote: What do you mean when you say it wont open the query? Non of the code opens a query, it passes a where argument to the report. Can you give some more detail on what you mean? "accessdesigner" wrote: as technically sound as it looks, (sad face) it wont open the query.... "Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#19
|
|||
|
|||
Klatuu -
(sad face) it never turned yellow....
"Klatuu" wrote: To post the code, it is a simple copy from the VBA Editor text into your post. You really need to learn how to trace the code to solve a problem like this. Open the form in design view. Open the code module. Go to the event where the code is. Put the cursor on the first line of executable code. Then means no Dims, comments, ect. A line that does something. Press F9 - The line will change color. Open the form. Click on the button. Go back to the VBA editor. The line you highlighted earlier will now be hightlighted in yellow. The highlighted line has not yet executed. Press F8 to execute that line of code. The next line that will be executed will now be highlighted. Just follow through the code to see what is happening. "accessdesigner" wrote: i dont know how to do that yet,... but when I click on the ok button.... it simply closes the form's screen... "Klatuu" wrote: Post back with the error number, description, and the line it occurs on. "accessdesigner" wrote: i mean, it wont read the commands correctly, so that the query could eventually open, it wont get past the commands.... "Klatuu" wrote: What do you mean when you say it wont open the query? Non of the code opens a query, it passes a where argument to the report. Can you give some more detail on what you mean? "accessdesigner" wrote: as technically sound as it looks, (sad face) it wont open the query.... "Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
#20
|
|||
|
|||
Klatuu -
When you pressed F9, did the line turn a reddish brown?
Did you press F8? "accessdesigner" wrote: (sad face) it never turned yellow.... "Klatuu" wrote: To post the code, it is a simple copy from the VBA Editor text into your post. You really need to learn how to trace the code to solve a problem like this. Open the form in design view. Open the code module. Go to the event where the code is. Put the cursor on the first line of executable code. Then means no Dims, comments, ect. A line that does something. Press F9 - The line will change color. Open the form. Click on the button. Go back to the VBA editor. The line you highlighted earlier will now be hightlighted in yellow. The highlighted line has not yet executed. Press F8 to execute that line of code. The next line that will be executed will now be highlighted. Just follow through the code to see what is happening. "accessdesigner" wrote: i dont know how to do that yet,... but when I click on the ok button.... it simply closes the form's screen... "Klatuu" wrote: Post back with the error number, description, and the line it occurs on. "accessdesigner" wrote: i mean, it wont read the commands correctly, so that the query could eventually open, it wont get past the commands.... "Klatuu" wrote: What do you mean when you say it wont open the query? Non of the code opens a query, it passes a where argument to the report. Can you give some more detail on what you mean? "accessdesigner" wrote: as technically sound as it looks, (sad face) it wont open the query.... "Klatuu" wrote: If this is part of the 8 combo thing you have been working on, it should be this: If Len(Me.subjSearch) 0 Then If Len(strWhere) 0 Then strWhere = strWhere & " And " End If strWhere = strWhere & "[subject] LIKE *" & Me.SubjSearch & "*" End If strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: I tried this but it does not work: strwhere = strwhere & "SELECT * FROM queryname WHERE [subject] = " & Chr$(34) & Me.[SubjSearch] & Chr$(34) "accessdesigner" wrote: how do u blend yours and Doug's statement together..... the whole report goes something like this for every record: date item# subject (so 3 fields) to do a query on... the date and item# is done, just need the user to be able to search by subject... "Klatuu" wrote: I don't know what you plan to do with it once you have it, but Doug Steele's example is what you need. SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyTextBox & "*" If you want to use strWhere, it would be: strWhere = "LIKE *" & Me.MyTextBox & "*" "accessdesigner" wrote: well, ya reading my mind pretty well.... i was attempting a textbox, but i still dont know how to use the statements correctly for that... the rest works,.... this my last pain.... plz helpppp, send a working example based on the strwhere statement... "Klatuu" wrote: Based on your last post, you should just use a text box rather than a combo box. If the search is to be completely free form, there is no need for a combo box. I am not clairvoyant, I don't even know what I am thinking about most of the time. "accessdesigner" wrote: YES, HE REALLY IS CLAIRVOYANT..... kudooos "Douglas J. Steele" wrote: Perhaps Klatuu is clairvoyant, and can understand your request, but for the benefit of the rest of us, what exactly are you looking for? Are you saying you want to let the user select a keyword from a combo box (or be able to type it in if it doesn't already exist in the combo box) and then select rows from the table where the keyword appears anywhere in the memo field? Your SQL will look like: SELECT * FROM MyTable WHERE MyMemoField LIKE "*" & Forms!MyForm!MyComboBox & "*" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "accessdesigner" wrote in message ... how do create a combo box to allow the user to type in keywords that is connected to a memo field within a query? could u show me an example of one that works... using the strwhere statement, but how is the combo setup, and its property fields? |
Thread Tools | |
Display Modes | |
|
|