A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Klatuu -



 
 
Thread Tools Display Modes
  #11  
Old November 21st, 2006, 08:29 PM posted to microsoft.public.access.forms
accessdesigner
external usenet poster
 
Posts: 89
Default 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  
Old November 21st, 2006, 08:42 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old November 21st, 2006, 09:05 PM posted to microsoft.public.access.forms
accessdesigner
external usenet poster
 
Posts: 89
Default 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  
Old November 21st, 2006, 09:15 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old November 21st, 2006, 09:21 PM posted to microsoft.public.access.forms
accessdesigner
external usenet poster
 
Posts: 89
Default 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  
Old November 21st, 2006, 09:29 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old November 21st, 2006, 09:32 PM posted to microsoft.public.access.forms
accessdesigner
external usenet poster
 
Posts: 89
Default 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  
Old November 21st, 2006, 09:52 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old November 21st, 2006, 10:01 PM posted to microsoft.public.access.forms
accessdesigner
external usenet poster
 
Posts: 89
Default 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  
Old November 21st, 2006, 10:06 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.