Re: Changing Seek with a Null to Findfirst Method

From: Dan (anonymous_at_discussions.microsoft.com)
Date: 07/13/04


Date: Tue, 13 Jul 2004 09:31:56 -0700

Thanks for all your help and pointing me to your site. I
really appreciate it.

Dan
>-----Original Message-----
>If you are still stuck after my last reply (parallel to
this one), this
>article explans how to build a WHERE clause, and the
techique is the same:
> http://allenbrowne.com/casu-07.html
>
>--
>Allen Browne - Microsoft MVP. Perth, Western Australia.
>Tips for Access users - http://allenbrowne.com/tips.html
>Reply to group, rather than allenbrowne at mvps dot org.
>
>"Dan" <anonymous@discussions.microsoft.com> wrote in
message
>news:2b5be01c468ec$8b0556d0$a601280a@phx.gbl...
>> Sorry about that last post. I had the field names
wrong.
>> I'm using the following code and am getting a data type
>> error. All fields are text and I'm not sure where to
put
>> the ' marks.
>> strsql = "SELECT * FROM tblOverAllowableBids WHERE
>> ((LoanNumber = " & Me.cboLoanNumber.Column(0) & ") AND
>> (ClientNumber = " & Me.cboLoanNumber.Column(1) & "))"
>>
>> Thanks again
>> >-----Original Message-----
>> >FindFirst accepts something that looks like the WHERE
>> clause of a SQL
>> >statement, so you can use:
>> >
>> >MyData.FindFirst "(Field1 = " & Me.cboCarNumber & ")
AND
>> (Field2 Is Null)"
>> >
>> >
>> >However, the best approah is to only fetch the records
>> you need, and specify
>> >your sort order like this:
>> >
>> >strSQL = "SELECT * FROM tblExtensionInfo WHERE ((Field1
>> = " &
>> >Me.cboCarNumber & ") AND (Field2 Is Null)) ORDER BY
>> Field1, Field2;"
>> >Set Mydata = MyDB.OpenRecordset(strSQL)
>> >
>> >
>> >Remember to add the quote marks as delimiters around
>> string values in the
>> >SQL statement, or # around date values.
>> >
>> >
>> >"Dan" <anonymous@discussions.microsoft.com> wrote in
>> message
>> >news:2ba9901c468d3$402521e0$a501280a@phx.gbl...
>> >>
>> >> The following code uses the seek method to find where
>> the
>> >> value in cboCarnumber does not match any records in
>> >> tblExtensionInfo.
>> >>
>> >> Set Mydata = MyDB.OpenRecordset("tblExtensionInfo"):
>> >> MydataOpen = True
>> >> Mydata.Index = "carSearch": Mydata.Seek "=",
>> cbocarNumber,
>> >> Null
>> >>
>> >>
>> >> How would I change this statement from Seek to the
>> >> Findfirst method?
>> >>
>> >> Thanks in advance for your help.
>
>
>.
>



Relevant Pages

  • Re: show 0 values
    ... Thanks Dan for your help. ... I removed the where clause and add those conditions into join ... reference the service in ref table, ... incident#, service, desc, date ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL Tuning question
    ... > sql queries. ... Dan, in my experience this very seldom makes a difference these days ... What is important in the predicate clause is using functions on the ...
    (comp.databases.oracle.misc)
  • Re: Need to search by date, but do not want the date reflected in results
    ... You should end up with a SQL statement that has a WHERE clause in the middle ... Allen Browne - Microsoft MVP. ... rather than allenbrowne at mvps dot org. ... > FROM consumenew ...
    (microsoft.public.access.reports)
  • Re: Limiting Records with Null Only Once
    ... it with field A is not null in an append query. ... Dan ... >You can use the Validation Rule of the table to insist ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.queries)
  • Re: Accessing multiple fields in report function
    ... Dan, you will need to pass all the fields from the record to your function. ... If the function is called CountTrue, and you need to pass 3 fields, you ... rather than allenbrowne at mvps dot org. ... > return a string containing the names of all of the boolean fields that are ...
    (microsoft.public.access.modulesdaovba)