findfirst - 2 search criteria

i wish to find a record based on 2 criteria, in this case i wish to search 
for a particular job id and then date type as each job id could have a 
multiple amount of date types.

rs.Findfirst "[Job ID] = " & aJob  AND "[Date Type] = " &aDate

i am not sure how to program the AND.

-- 
thanks
liz
0
Utf
9/29/2007 4:40:00 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
2534 Views

Similar Articles

[PageSpeed] 45

liz wrote:
> i wish to find a record based on 2 criteria, in this case i wish to
> search for a particular job id and then date type as each job id
> could have a multiple amount of date types.
>
> rs.Findfirst "[Job ID] = " & aJob  AND "[Date Type] = " &aDate
>
> i am not sure how to program the AND.

It goes inside the quotes.  You also need to delimit a date with #.

rs.Findfirst "[Job ID] = " & aJob  & " AND [Date Type] = #" & aDate & "#"

-- 
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com


0
Rick
9/29/2007 4:57:14 PM
Reply:

Similar Artilces:

Searching Leads by company name..
I have been assigned as part of my daily job duties to start getting some of MS CRM issues addressed. Most of the issues are small, but lead to a company wide feeling that the tool is not yet living up to its full potential. I have two questions at this point: Is there any way to change the default search criteria for when searhing through "leads" to allow for a user to search the company name? The default settings only allow a person to search for a persons name. Is there any way to transfer the notes from a lead into an account record when it is converted? As it stands w...

CDaoRecordset::FindFirst() usage
As a novice on database, I am trying to use CDaoRecordset::FindFirst() function just to check if certain 'Serial Number' exists in other table but it throws following error: Error(3077): Syntax error (missing operator) in expression. Please see following code: .... ASSERT(m_pDB->IsOpen()); CDaoTableDef td(m_pDB); CDaoRecordset rs(m_pDB); // convert serial number string to long number char *end; long UnitNum=lstrtol(GetSerialNum(),&end,10); BOOL faulty = FALSE; try { td.Open((LPCTSTR)(_T("Table 1"))); } catch (CDaoException* e) { m_pView->DisplayD...

Another Question regarding Multiple Criteria
My apologies if I have repeated myself. As I thought I may have closed off the question yesterday. Hi Following on from this and thank you for your help, is there a way that this will select in col D all characters except 1 or 2 (eg I would like to accept everthing except A) Thanks Anne "T. Valko" wrote: > Try this... > > If column N contains numbers only (or possibly empty cells) > > =SUMPRODUCT(--(B2:B10="QN"),--(C2:C10="IM"),--(D2:D10="R"),--(N2:N10<>0)) > > Better to use cells to hold the c...

Searching in knowlegdeBase by GP Version
I saw you're working on searchig in customersource to make searches more efficient, so I thought that there is a way to perform a search more exactly to spend less time. A great Idea for Searching in knowlegdeBase is doing by GP Version, I mean (Spanish ES-LA), (United States EN), that's an easy way to find: 1.-Products Update 1.-Articles For example: Sometimes I find some articles or downloads, but the says "Current Release: English: Release 8.0" if I want to search this item for "Spanish Version", in this way I can do it better. Thanks. ---------------- Th...

findfirst
I have a form with 6 fields on it, some text boxes and some combo boxes. The first box is a combo box of names. The second box is the person's ID number. I have set up a findfirst method so that when you select a name from the first box, the id for that person shows in the second box (if that person is in the list). The rest of the boxes on the form are more info on that person. I want those fields to fill in as well as the ID field when I select the name from the first box. I can't seem to figure out the code. I keep getting the id number in all the fields after I select the na...

Searching HTML Files?
Ok two questions: 1. Does anyone know of a way for Excel to automatically update stock quotes in it's cells. Basically this is what I want to achieve: There's a Cell called "stock quote" and that cell would always contain the most recent stock quote for a company. I would then use this number to perform financial analysis. 2. Also, this might relate to Q#1. Is there anyway for Excel functions to search the text inside websites/HTML files? I am familiar with VBA, but not Excel. I would like a cell, using If statements, to say "True" if it has the string &q...

Findfirst type mismatch error
So I'm stumped I have two fields that are able to have duplicates in them but combined will not so I need to do my search criteria to include both of them Private Sub Command3_Click() Dim MyRst As DAO.Recordset Dim InputString As String Dim acn2 As String InputString = find acn2 = accountnumber2 Set MyRst = Me.RecordsetClone MyRst.FindFirst "[InvNum] = " & (InputString) And "[AccountNumber] = " & Me![accountnumber2] If MyRst.NoMatch Then MsgBox ("No Data with this ID found") Else Me.Bookmark = MyRst.Bookmark End If MyRst.Close Set MyRst = Nothing ...

Search for Special Characters
This is a multi-part message in MIME format. ------=_NextPart_000_017B_01C422CB.3F61B550 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Is there any way to search for special characters in Excel, like a tab, = for example? I haven't been able to find one. --=20 Best Regards, Clark Murray ------=_NextPart_000_017B_01C422CB.3F61B550 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD>...

Program search
Is there a program to calculate a total out of a list of numbers? The problem I am having is that I have one total on my bank statement, but several numbers that might make up the total. I need a program that will make it easier for me to figure out what makes up the total An example using solver http://tinyurl.com/4u93n Regards, Peo Sjoblom "Gwen" wrote: > Is there a program to calculate a total out of a list of numbers? The > problem I am having is that I have one total on my bank statement, but > several numbers that might make up the total. I need a pr...

OWA Contact search
Hi, We are using OWA 2003, We would like to configre that all our users will search in OWA in contact folder and no GAL by default We don't want that our uses will go to Contact Options >> Check names first in and change to Contacts, is there any option to change this automaticaly for all our users ? Thanks ...

You search woman for friend?
If you search girl for pen pal and more, it for you! I'm single girl and i search single man, I'm 33yold. my e-mail: nataliunna@gmail,com If you search woman for pen pal and more write to me and i can send to you my new pics and tell more about myself. I post this message from this forum because i don't have credit card and can't pay of dating site. If you want find a friend please write to me. I wait your message on my email. Natalya. -- nataletka69 ------------------------------------------------------------------------ nataletka69's Profile: http://www.excelforum...

findfirst() findnext()
how to recurse through the directories and list the files names of all init any sample code or app? -- Thanks, Arvind Here is an example of how to use MFC's CFileFinder class which encapsulates the findfirst and findnext methods. Anyway the concept is the same. int NumberOfFiles(CString strDir) { int nFiles = 0; CFileFind finder; BOOL bWorking = finder.FindFile(strDir+"\\*.*"); while(bWorking) { YeildToOthers(); bWorking = finder.FindNextFile(); if(!finder.IsDots()) { if(!finder.IsDirectory()) { nFiles...

File Search Question
What MFC function can search a directory for files matching wildcard criteria? There is a class called CFileFind. Use the FindFile and FindNextFile methods. AliR. "Peter Olcott" <olcott@att.net> wrote in message news:cKmne.12587$fp.194@fed1read05... > What MFC function can search a directory for files matching wildcard criteria? > > ...

FindFirst with numeric field
For some reason I'm having a lot of problems getting a findfirst to work. First I tried comparing to a text field but that didn't work. Now I'm trying to compare to a numeric field (ID) but that's not working either. The first line is I believe correct for a text field. What is the correct syntax if the field is numeric? Thanks for any help on this. rsCategories.FindFirst "ID = '" & Category & "'" rsCategories.FindFirst "ID = " ???????? rsCategories.FindFirst "ID = " & Category -- Doug St...

search macro
Hi, does anyone know how to make a macro that would search for text tha is in a cell?...Here's what I have, in A2 I have inserted a validatio list and at the end of the cell I made a command button from the form toolbox and would like to attach a macro that would search for what i in cell A2, there are multiple entries for each name in the list so i would have to find them one at a time and then go back to the top i there are no more to be found down in the worksheet! Thanks Jean-Guy Collette Canad -- Message posted from http://www.ExcelForum.com Hi Jean-Guy Record a macro while perf...

searching information stores
I am looking for a tool that will search all mail messages in the information store. Is there something out there like this? My boss is asking. Thank you Quest has a tool to do this as does OnTrack. I believe Quest's solution is called Recovery Manager for Exchange and OnTrack's product is called PowerControls. NEMX software also has a product called PowerTools for Exchange - can't recall if this does the same thing or not, though. -- Ben Winzenz Exchange MVP "KatPavelka" <k.pavelka@comcast.net> wrote in message news:u3IZsLWNFHA.3192@TK2MSFTNGP10.ph...

FindFirst question
hello When using code to find a table record that matches a given value, does the 'FindFirst' need to be preceded by 'MoveFirst'? should the code read as... Dim... ......etc Set rs = Me.recordset.Clone rs.FindFirst strSearch .... or... Dim... ......etc Set rs = Me.recordset.Clone rs.MoveFirst rs.FindFirst strSearch .... When studying code samples in this site and others, I've seen it done both ways. Things seem to work fine without the MoveFirst, but maybe I'm just getting lucky. Is MoveFirst needed? Why/Why not? thanks in advance T...

Counting records and Where criteria
I'm trying to count the number of records between date parameters. I have a query that I'm using the Count function to count the number of txtrefnbr and in the Criteria I've used Where [txtdaterecd]=Between [Forms]![frmdates]![txtfrom] And [Forms]![frmdates]![txtto] But I get an invalid syntax error. Anyone help? Thanks Tony What is [txtdaterecd]? If it is a field in a table, when you open the table in design view, is it a Date/Time field? If it is a calculated query field, wrap the calculation in CVDate() so Access understands the data type. If txtfrom and txtto are un...

Searching
Can anybody help me by providing a formula to look down a column withi Excel that has a defined name, and list all the row numbers from tha column that matches a cell content - example - In sheet 1, I have column with loads of peoples first names and in sheet 2, I want to loo for the name "Frank" so in in sheet 2 there is a box I write "Frank" an below that all the row numbers from sheet 1 where "Frank" is writte would be listed in numeric order - this then would allow me to inde those row numbers to get other detail -- spar ------------------------------------...

FindFirst sticking with first record?
I have a combo box that queries from a table of people to get a list of names, ordered lastname, firstname, peopleID. There are several people in this list that have the same last name, and no matter which person I choose with that last name, Access chooses the first person with that last name. (So effectively, if I have Smith Jon 1, Smith Jane 8, Smith Harold 9074395, it'll always stick with Smith Harold 9074395.) The VBA behind this is: Private Sub Combo26_AfterUpdate() ' Find the record that matches the control. Dim rs As Object Set rs = Me.Recordset.Clone rs...

searching for users or other objects
In AD/Exchange Is there a way to configure the find feature in Exchange to show you WHERE the object is you're searching for? For instance, I need to locate John Doe's account. I right click on the domain in Active Dir Users and Computers (using mmc) and select FIND. The find feature works great, but it doesn't tell me WHERE the user is like the normal Windows Search does. We have many office locations and the users are broken down accordingly. drilling down is sometimes time consuming Can it be done? Or is that just the way it is? Does Windows control the find featur...

findfirst problem
Hi all, I have this piece of code which gives me an error : 3072 unknown function name when I execute rst2.FindFirst cKey. In immediate mode my cKey seems to be correct. Sub UpdateCustomer() Dim cCustomer As String, cNameCustomer As String, cKey As String Dim db As DAO.Database, rst As Recordset, rst2 As Recordset, wsp As Workspace Set wsp = DBEngine.Workspaces(0) Set db = CurrentDb Set rst2 = db.OpenRecordset("Customers", dbOpenSnapshot, dbReadOnly) rst2.MoveLast: rst2.MoveFirst Set rst = db.OpenRecordset("MyOtherTable", dbOpenDynaset) rst.MoveLast: rst.MoveFirst ...

excel VBA
How would i search a range of a whole column instead of specific cells like .Range("a1:a300")? --- Message posted from http://www.ExcelForum.com/ ..range("a:a") ..columns(1) ..range("a1").entirecolumn are a few ways. "Zygoid <" wrote: > > How would i search a range of a whole column instead of specific cells > like .Range("a1:a300")? > > --- > Message posted from http://www.ExcelForum.com/ -- Dave Peterson ec35720@msn.com ahhh! Thanks!! I was trying .Column(1) i see i neede an "s" in there Thanks a...

Multiple fields using to search
Hi, Something i've been batteling for weeks with and theres probably such a simple answer to it and i just cant see it: Riiiight, i have this form (lets call it frmClientSearch) On this form i have a 2 list box thinghys; One called lstEmployee which is populated with Employee names and the other lstCity which is populated with City Names. Then i have a command button (cmdSearch) which, once click and values selected in both the lst boxes, should return only the values that are equal to both the lst boxes in a new form called frmSearchResult. (Hope i make sense) So... I know how ...

Search, Search, Thanks
In the last couple of weeks I have been fighting with different ways o synching my laptop and my home pc. I have ended up with numerou duplicate entries, duplicate address books and duplicate contact lists ALL of my questions/problems I was able to resolve simply by searchin through the forums. Chances are if you have a problem you're not th first. There are some really good people on these forums that know alo more about Outlook than I do. Just my .02 Thank ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages dir...