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

Pass value from unbound control to form

Status
Not open for further replies.

TheVMan

IS-IT--Management
Feb 19, 2001
110
US
I am not sure if I'm going about this wrong or what. I have a form where the user enters a partial string in an Unbound Control. The button is pushed which opens the next form and passes the value in that control to the next form. I'm certain that piece is working OK. The problem I'm having is, I want the form to open with a query that will do a wildcard search with the value in that string. I've made the form's query source include a condition like so:

[Column] Like "*Me!txtUnboundControl*"

This doesn't seem to work.

Any suggestions?

Thanks in advance.

V
 
hi,

it's just a guess but try

like "*" & me!unboundcontrol & "*"

the kid
 
Still no good. I changed my where clause to this:
WHERE (((tbl.Column) Like "*" & Me!txtUnboundControl & "*"))

Any other suggestions?
 
Have you considered instead of using a query as the form's source opening the form using a filter. It works far better.
Here is a sample of code I use to open forms
Dim stDocName2 As String
Dim stLinkCriteria2 As String
stDocName2 = "frmSOPMasterList"
stLinkCriteria2 = "[SOP_txt_SOPNumber] Like" & "'" & Me![SOPNumber] & "'"
DoCmd.OpenForm stDocName2, , , stLinkCriteria2
DoCmd.Close acForm, "fdlgSOPMasterList"

The user can add in part of the text plus the wildcard and it opens all appropriate records. But they can then do more filters or remove the filter without Access asking them to provide the field you originally use as a search criteria.

I took over a database that opened forms on queries and every time the user tried to perform filter by forms etc they were queried for unnecessary information annoying them no end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top