Re: Search for a record based on one of two fields
- From: "Luke Bedggood" <LukeBedggood@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 16 Aug 2005 01:13:02 -0700
Afraid it still does not work - it would appear to be a syntax error (the
text comes up in red and the compiler reports a syntax error)
it is most perplexing!
thanks for your help so far
"Luke Bedggood" wrote:
> Hi Allen
>
> Thanks for this - unfortunatly I cannot get it to work as it claims a
> bracket is missing.
>
> I have managed to get the compilier to accept the following (it uses my
> field names)
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> stDocName = "frmTechnicalPartNumberView"
>
> stLinkCriteria = ("[altec_switchno]=" & "'" & Me![txtPartNumber] & "'")
> Or _
> ("[altec_maxitem]=" & "'" & Me![txtPartNumber] & "'")
>
> DoCmd.OpenForm stDocName, , , stLinkCriteria
>
>
> however when run it says 'type mismatch' and nothing else. any further
> insight you can add would be appreciated.
>
> regards
>
> Luke
>
> "Allen Browne" wrote:
>
> > So you want to search to find a matche in either field:
> >
> > Dim strWhere As String
> > strWhere = "([fldPartNumber1] = """ & Me.[txtSearch & _
> > """) OR ([fldPartNumber2] = """ & Me.[txtSearch & """)"
> >
> > You can then set the form's Filter to this string and FilterOn = True, or
> > you could FindFirst in the form's RecordsetClone and set the Bookmark.
> >
> > --
> > 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.
> >
> > "Luke Bedggood" <LukeBedggood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:C2358A7C-D21F-4C3A-98A5-CCF5645CF5AF@xxxxxxxxxxxxxxxx
> > > Basically..
> > >
> > > I have a text box which is the search data (a part number) & a button that
> > > says start the search (using the info in the text field)
> > >
> > > I have a whole bunch of records, and because of my companies semi-adoption
> > > of two systems, we have inadvertantly ended up with two part number
> > > references per actual part - both have a seperate field in the record, but
> > > what I would like to be able to do is that should a search not reveal the
> > > part number in the first field, to search the second and then bring forth
> > > the
> > > relevant detail
> > >
> > > ie a record has a fldPartNumber1 (example data: Part Number) and a
> > > fldPartNumber2 (example data: Number, Part)
> > >
> > > I would like the user to be able to enter and search against either part
> > > reference by entering the search into a single box, hitting 'go' and the
> > > correct record being returned.
> > >
> > > Fortunatly there is no possibility of duplications in either field, both
> > > next to each other, and throughout the entire recordset......
> > >
> > > thanks for any insight
> >
> >
> >
.
- References:
- Search for a record based on one of two fields
- From: Luke Bedggood
- Re: Search for a record based on one of two fields
- From: Allen Browne
- Re: Search for a record based on one of two fields
- From: Luke Bedggood
- Search for a record based on one of two fields
- Prev by Date: Re: reference in subform
- Next by Date: RE: New Thread for Creating a record in a table from an event on form
- Previous by thread: Re: Search for a record based on one of two fields
- Next by thread: Re: Search for a record based on one of two fields
- Index(es):
Relevant Pages
|