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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Form Field toQuery

Status
Not open for further replies.

fredpeters555

Technical User
Jul 16, 2003
19
CA
I have a radio group 'frView' on a form that a user selects the conditon of a field he wishes to filter, displays the results in textfield 'txtViewName1' for the user to view.

The query then calls the results of 'txtViewName1'.

Codes for both the form and query follow.

Although I get the proper results for 'All' and 'N/A', it does not return ANY results for the 'NOT N/A'.

Via Select case, I have tried all variations of txtViewName1 = 'not', '<>','&'and '*', all to no avail.



Using the following code to populate txtViewName1:
----------------------------------------------------------
Code:
Select Case frView
      Case 1
        'All
        txtViewName1 = "*"
      
      Case 2
        'Assigned
        txtViewName1 = "NOT N/A"
      
      Case 3
        'Un_Assigned
        txtViewName1 = "N/A"
         
    End Select
    DoCmd.Requery

The sql view for the query is:
---------------------------------
Code:
SELECT IPScheme.ID, IPScheme.tIPGroup, IPScheme.tIP, IPScheme.tLocation, IPScheme.tDone, IPScheme.tMake, IPScheme.tModel, IPScheme.tDesc, IPScheme.tNotes
FROM IPScheme
WHERE (((IPScheme.tIPGroup) Like [Forms]![fIPScheme]![txtGroupName]) AND ((IPScheme.tIP) Like [Forms]![fIPScheme]![txtBranchName] & "*") AND ((IPScheme.tLocation) Like ([Forms]![fIPScheme]![txtViewName1])) AND ((IPScheme.tDone) Like [Forms]![fIPScheme]![txtDone]));
----------------------------
PLEASE!! any suggestions?
 
txtViewName1 = "NOT 'N/A'" ?
txtViewName1 = "NOT LIKE 'N/A'" ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top