Enter data for query from VBA

thomas49th

New member
Local time
Today, 02:05
Joined
Mar 11, 2007
Messages
8
Hi, I have a query which is open ended (user enters data when clicks on it). I have a form with a textbox on it and command button. How do I make it so when the user clicks the command button the text in the textbox is entered into the query by VB from modMain? The textbox is text1 and command button is command1. The field in the query which is queried is Type and it's a string data type.

Hope this makes sense
Thx
;)
 
You need to call/use a global function, or simply just refer to the textbox from that query.
 
Well im going to validate the data in VB when the user clicks the command button. That works. Im just not sure how to put the textbox data into a query... can you give me an example?
 
In the code:

Me![myTextboxName] = myTextvar

In the "terms" field in your query:

Like [Forms]![myFormName]![myTextboxName]
 
Cheerz.

Now my query works fine, but I have another question

From my query, how do i take each returned record's field "type" and put that into a string, each one parsed with a semi-colon ";", in VBA.

Thx
 

Users who are viewing this thread

Back
Top Bottom