Discussion Locked

Need to set value for a field in a query

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I neeneed to be able to set the value for the field in a query. I want the user of the program to be able to choose the field he wants to search through a combo box.

WHERE [tblBugs].[=[frmBugEntry]![FieldList]] = [frmBugEntry]![TextSearch]

The above code was taken form the Accesss2k SQL view of the query. I am at a comlete loss here so any help you can provide for the few points I have offered would be appreciated.

2 replies

by wessir

In Access Query design window (QBE Grid) you can get parameters from the user by entering brackets around your question [Enter variable?] and putting it on the "criteria" line. Whenever access encounters the brackets [] and doesn't recognize the variable it prompts the user for it. If you want to change the actual field that is being searched rather than the criteria used, you must modify the QueryDef object at run time using visual basic. (far more difficult but possible)

by cynder

If you could go into further detail on the QueryDef object alterations that I amy need to make then you could end up with all the points, I already nkow about the [] braces.

-cynder

This discussion is closed to new replies.