Re: Changing Seek with a Null to Findfirst Method
From: Dan (anonymous_at_discussions.microsoft.com)
Date: 07/13/04
- Next message: Sandra Daigle: "Re: subform recordsource"
- Previous message: Sandra Daigle: "Re: DAO Edit Mode"
- In reply to: Allen Browne: "Re: Changing Seek with a Null to Findfirst Method"
- Next in thread: Sandra Daigle: "Re: Changing Seek with a Null to Findfirst Method"
- Messages sorted by: [ date ] [ thread ]
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.
>
>
>.
>
- Next message: Sandra Daigle: "Re: subform recordsource"
- Previous message: Sandra Daigle: "Re: DAO Edit Mode"
- In reply to: Allen Browne: "Re: Changing Seek with a Null to Findfirst Method"
- Next in thread: Sandra Daigle: "Re: Changing Seek with a Null to Findfirst Method"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|