Re: recording Macros

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I did not see where you included what the immediate window gave you. It took me a while to figure out Debug.Print. Just to be sure we are on the same page, and with no attempt to offend if you are in fact familiar with it, the way it works is this: After running the code (in the case of the command button code in the other thread, by clicking the command button), press Ctrl + G to open the VBA editor to the Immediate Window. There should be a text string there along the lines of:
([SNM TYPE] = "SomeValidTextValue")

or

([SNM TYPE] = "(All)")

BTW, I don't see that the parentheses in the text strings are accomplishing anything, and they may be hurting.

Anyhow, this is your filter string.

"NukeEng85" <NukeEng85@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:8D787645-D9FB-4FAE-9DFD-9D97ED7CCF9C@xxxxxxxxxxxxxxxx
I think I may have just realized what happened. I thought the command button
code was what you were asking for in regards to the Debug.Print line code. I
did include what the "immediate window" gave me, I must not know how to
verify the string being produced by the code, I thought that's what I was
doing, my apologies!

"BruceM" wrote:

In another thread you posted what you idenitifed as After Update code. I
pointed out that there was no After Update code, so nothing would happen
when selecting from the combo box. A response from you would have shown
that you understand (or not) why selecting from the combo box could not
accomplish anything. You posted command button code that may work to filter
the records provided that both combo boxes contain a selection, and that
neither contains (All). However, you did not respond to my observation that
selecting (All) and clicking the command button will produce no results,
given the command botton code as posted. I also suggested that you verify
the string being produced by the code. The Debug.Print line of code would
have accomplished that.
These are the sorts of things to which I referred. Following the suggestion
to verify the filter string it would have been helpful to know if you had
done so and what you had discovered. That new information would have helped
narrow down the problem, which would have increased the chances of finding a
solution.
I'm not trying to take you to task for newsgroup etiquette, but rather
pointing out that a careful reading of and effort to implement posted
suggestions can lead to a solution. Even if you tried the suggestions, a
brief response that makes no mention of that is somewhat unlikely to draw
further responses and suggestions, at least no in depth.

"NukeEng85" <NukeEng85@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F8AB1460-2C9F-4D9C-AB6E-C7D13453FB42@xxxxxxxxxxxxxxxx
> Bruce,
>
> Thank you for your suggestion, I will try to be more clear with my
> responses
> concerning problems I'm having with the codes. I actually have been
> continuously checking all the threads I have started, and I tried what
> both
> yourself and Douglas Steele suggested, and was still having problems. > I
> have
> since then figured out a different way to produce the same results, > which
> is
> why I didn't respond.
>
> As far as providing more details, I'm not sure what other details > people
> need as I have posted the Macro code multiple times, and all of the > event
> builder and query information I have. If there is something I'm not
> including I would really appreciate your input because I am trying to > do
> what
> I can to help the people who are being so kind as to help me. What > should
> I
> respond when I try something that someone suggests and I get no > results?
> I'm
> obviously not very in-tune with the posting etiquette, thank you for > your
> assistance.
>
> "BruceM" wrote:
>
>> This is just some thoughts about newsgroup postings. In this thread >> you
>> asked a question, then without waiting for an answer proceeded to the
>> conclusion that the suggestion doesn't work. The comment that the >> code
>> is
>> not right "if one of the combos is not set" probably means that if one >> of
>> the combo boxes is null or does not contain a valid item the code will
>> not
>> work.
>>
>> In another thread you responded to a suggestion with what strikes me >> as a
>> somewhat dismissive "I did what you said, and still no results, thank >> you
>> for trying." You have now apparently abandoned that thread. However,
>> the
>> suggestion made in that thread by Douglas Steele will work, but you >> did
>> not
>> respond to the request for further details. My suggestion in that >> thread
>> would have worked too, but again details about your database were
>> missing.
>> If for whatever reason you choose not to follow through on a suggested
>> course of action that is your choice, but please do not hurry to the
>> conclusion that the problem is with the suggestion, especially if you >> do
>> not
>> respond to requests for clarification.
>>
>> For best results, be specific about error messages or the exact nature >> of
>> the failure. Responses such as "It did not work" are too vague.
>>
>> "NukeEng85" <NukeEng85@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:20310D6D-BB67-4792-B508-348B60A8C572@xxxxxxxxxxxxxxxx
>> > Also, I tried using your code, and I still have to manually set the
>> > filters
>> > with the toolbar buttons for it to work. Thanks anyways!
>> >
>> > "Albert D. Kallal" wrote:
>> >
>> >> > strWhere = strWhere & "([SNM TYPE] = """ & Me.Combo22 & >> >> > """)
>> >> > AND "
>> >>
>> >> Is snm type a number type field, or text type field. (you have to
>> >> check
>> >> in
>> >> the table desing view to be sure). I also perfer the user of single
>> >> quotes
>> >> as it bit less " plahing.
>> >>
>> >> eg:
>> >>
>> >> strWhere = strWhere & "([SNM TYPE] = '" & Me.Combo22 & "' AND "
>> >>
>> >> Also, code is not quite right for if one of the combos is not set.
>> >>
>> >> Try:
>> >>
>> >> If Not IsNull(Me.Combo22) Then
>> >> strWhere = "([SNM TYPE] = '" & Me.Combo22 & "')"
>> >> End If
>> >>
>> >> If Not IsNull(Me.Combo24) Then
>> >> if strWhere <> "" then
>> >> strWhere = strWhere & " and "
>> >> end if
>> >> strWhere = strWhere & "([ICA] = '" & Me.Combo24 & "')"
>> >> End If
>> >>
>> >> if strWhere = "" then
>> >> MsgBox "No criteria, all data will show", vbInformation, >> >> "Nothing
>> >> to
>> >> do."
>> >> end if
>> >>
>> >> debug.print strWhere
>> >> me.Filter = strwhere
>> >> me.FilterOn = true
>> >>
>> >> Note how the 2nd conditaiton of code is desinged to "add" to the
>> >> previoues
>> >> codndin. yOu cna contineu that same block of code for as many
>> >> additonal
>> >> contorls onthe frm. And, if none of the ocntorls are filled..then
>> >> stWhere
>> >> will = blank.
>> >> Also, after the above code runs, take a look at the debug.print of >> >> the
>> >> strWhere...does it look correct?
>> >>
>> >> So, remember, if ica, or snm type are number fields, then your code
>> >> looks
>> >> like:
>> >> strWhere = strWhere & "([ICA] = " & Me.Combo24 & ")"
>> >>
>> >>
>> >> -- >> >> Albert D. Kallal (Access MVP)
>> >> Edmonton, Alberta Canada
>> >> pleaseNOOSpamKallal@xxxxxxx
>> >>
>> >>
>> >>
>>
>>



.



Relevant Pages

  • Re: incr (was: Re: A little bit of math)
    ... could be used to also verify that the string was incrementable. ... initializing it to an integer cause some other part of the program to ... That's why I like my suggestion; ... I have actually wished there was a built-in command that worked ...
    (comp.lang.tcl)
  • Re: ascii commands for RS232 comunication
    ... where s is my COM obj ... when I check the response, ... with the command ... how you call the device to send it that string is another ...
    (comp.soft-sys.matlab)
  • how does the Model (Command), in MVC, return objects to a servlet?
    ... Should Command return complex objects to a servlet, ... It must go through the servlet controller. ... return a String and Thing.getRequest, ... String page = command.execute(request, response); ...
    (comp.lang.java.help)
  • Re: Connecting modem thru code
    ... You need to pass a command string to the modem, ... Just from memory "ATO" should put the modem online, and you get a response ...
    (microsoft.public.access.formscoding)
  • Re: Asking modem for Dial tone
    ... You need to pass a command string to the modem, ... Just from memory "ATO" should put the modem online, and you get a response ...
    (microsoft.public.access.formscoding)