Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Search Dialogue Form - Different Search Options?

Status
Not open for further replies.

Maillme

Technical User
Mar 11, 2003
186
NL
Hi there, rather than me trying to describe my form - here it is:
Basically,. this form has no coding or anything behind it - but i need to know how to get it to work, and my "using access 2000" book isn't helping me this time :( - and im not really a coder.


Anyhow - the 2 radio buttons, are for the user to choose which set of data they wish to search - this data is held in two different tables:

tble_issue_log - this hold my issues details
tble_training_log - this hold my training details

The radiob uttons on the right hand side refer to fields within these tables.....

log number and issue number refer only to datas within my tble_issues_log table, where as first name and surname is a field within both tables.

Anyhow - i want the user to be able to search on these fields, depending on what they pick on the right hand side, and ofcourse what they enter in the text field, but, i have no idea how to even start coding this :(

Any help is greatly apprecaited,

Many thanks,

Neil
 
Alternately, you can do it this way, this is how I do it in my forms, except I use combo boxed, but you should be able to work it out...

Code:
    dim searchfilter as string
    If Me.cmbSearchType.Value = "RMA Number" Then
        searchfilter = "[qryFailure]![RMANumber] Like '*" & Me.txtSearch.Value & "*'"
    End If

That code creates a filter for the open form command that edits my query [qryFailure] to only return results that are "Like * <user entered value> *". I then apply "searchfilter" to the open form command like so:
Code:
DoCmd.OpenReport "rptFailureReport", acViewPreview, , searchfilter
All of this code will go under the "Search" button on your form. Then all you would need to do is create a statement like the first one above that would be equal to each of the radio buttons on your form...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top