> Thanks for the tips. The problem, however, isn't with the results of
> the wherecondition. There aren't any results because the code just
[quoted text clipped - 5 lines]
> I'll be so lucky. I just don't have many ideas as to why code would
> work on some machines and not others.
I got it working. It was an issue with the references. But now you
have my curiousity. Is there a better way of doing this? With regard
to the .Value vs. .Text, I used .Text because the combo box would
return the index value (1, 2, 3, etc.) rather than the text value.
Anyway, thanks for your help!
Just to pick your brain a bit, I'm trying to come up with some code to
add to this that will count the number of records matching the criteria
(e.g. records of contact with the first name "Jim"). If there is only
one, I want to circumvent the intermediary form that displays the
search results and just go straight to the full record. Does that make
sense? I know there has to be a way of doing this, but I don't know
how easy/difficult it may be.
jimfortune@compumarc.com - 29 Sep 2005 23:30 GMT
> I got it working. It was an issue with the references. But now you
> have my curiousity. Is there a better way of doing this? With regard
> to the .Value vs. .Text, I used .Text because the combo box would
> return the index value (1, 2, 3, etc.) rather than the text value.
> Anyway, thanks for your help!
I'm glad I was able to help point you toward a solution. Value works
fine even when index values are returned. Google this NG to find out
the subtle difference between .Value and .Text.
> Just to pick your brain a bit, I'm trying to come up with some code to
> add to this that will count the number of records matching the criteria
[quoted text clipped - 3 lines]
> sense? I know there has to be a way of doing this, but I don't know
> how easy/difficult it may be.
Bringing up only the full record when there is only one match is an
excellent idea. I think I'll implement that into some of my search
forms tonight. Thanks for the idea. I've used that idea many times
before but not with search forms. I was just being lazy I guess. My
unbound search form generates ad hoc SQL that can be used to count the
number of results. If the RecordCount is one, I can skip the
SearchResults form and go directly to the Info form. Post back if you
have any difficulties.
James A. Fortune
Do you do anything besides play pool? -- Tom
jimfortune@compumarc.com - 30 Sep 2005 06:53 GMT
> Just to pick your brain a bit, I'm trying to come up with some code to
> add to this that will count the number of records matching the criteria
[quoted text clipped - 3 lines]
> sense? I know there has to be a way of doing this, but I don't know
> how easy/difficult it may be.
This turned out to be pretty simple.
On the Form_Load event of frmSearchResults I now have something like:
Me.RecordSource = GetSearchSQL()
If Me.RecordsetClone.RecordCount = 1 Then
Call cmdSelect_Click
End If
James A. Fortune