gettin vaules from a form object

purejoker

New member
Local time
Today, 10:49
Joined
Nov 21, 2005
Messages
6
hi every1!
umm.. i have a problem... with a sql query that i want to put on combo box.
the query goes like this:
SELECT custname.[Customers] FROM Customers WHERE =[Forms]![Invoice1]![ CustID];

=[Forms]![Invoice1]![ CustID]; this is ment to get the vaule from another txtbox or combo box on the same form.

but this doesnt work... does any1 no the correct way of doin it.

basiccly i want the sql query to grab data from a txt box or combo box n then show the correct data, matcing it agaist a table.
this all goes in the row source...

thanx in advance!

Purejoker!
 
Something like:

SELECT Customers.custname FROM Customers WHERE = Customers.custID = '" & [Forms]![Invoice1]![ CustID] & "';"

???
 
Surely the first = shouldn't be there?:confused:
 
:o

SELECT Customers.custname FROM Customers WHERE Customers.custID = '" & [Forms]![Invoice1]![ CustID] & "';"

(Not really sure the rest is 100% correct :o )
 
thanxs for helping but its coming up with this error

'characters found after end of SQL statement' fixed this 1 by removing the ;
the next error is saying 'data type mismatch in criteria expressions'

i have no idea wot that mean...can some1 help plzzz....

thanxs in advance!

Purejoker!
 
Last edited:
"SELECT Customers.custname FROM Customers WHERE Customers.custID = " & [Forms]![Invoice1]![ CustID]

???
 

Users who are viewing this thread

Back
Top Bottom