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

passing values

Status
Not open for further replies.

makisbest

Technical User
Mar 3, 2005
125
GR
Hi All

How I can pass a value from a drop down menu in a form
to a query creteria?

Thanks
 
If the box is bound to a field then just put the name of the field in the criteria
ie. =[nameOfField]

Ian Mayor (UK)
Program Error
Programmers do it one finger at a time!
 
If the box is not bound then you need to use...
[forms]![NameOfForm].[NameOfComboBox]

Ian Mayor (UK)
Program Error
Programmers do it one finger at a time!
 
How I can use a like statement

SELECT dbo_tblWarehousePositions.WPDescription, dbo_tblWarehousePositions.WPBarcode
FROM dbo_tblWarehousePositions
WHERE (((dbo_tblWarehousePositions.WPDescription) Like '[Forms]![Main]![combobox0]%'))
ORDER BY dbo_tblWarehousePositions.WPDescription;
 
Note the changes in the where statement

Code:
SELECT dbo_tblWarehousePositions.WPDescription, dbo_tblWarehousePositions.WPBarcode
FROM dbo_tblWarehousePositions
WHERE (((dbo_tblWarehousePositions.WPDescription) = [Forms]![Main].[combobox0]))
ORDER BY dbo_tblWarehousePositions.WPDescription;
N

Ian Mayor (UK)
Program Error
Programmers do it one finger at a time!
 
Ok.

I want to use like statment not iqual (=)

How I can syntax that.
 
Code:
Like '" & [Forms]![Main]![combobox0] & "'"

Have fun! :eek:)

Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top