copy textbox input to excel

SteveGr

Registered User.
Local time
Today, 19:41
Joined
Aug 2, 2002
Messages
65
Hi all,

I have a button on my form that runs a macro that runs a make table query. On my form I enter the start date an end date of the range I want to query. I have fields in my query to pull the min date and the max date to get the dates so I can export the dates into an excel spreadsheet. But I would like to have the actualy input dates that I put in the text boxes to show up, not the queried dates.

Anyone know how to acomplish this?
Thanks, in advance for you help, SteveG
 
Just use an expression like this in your maketable query (filling in the name of the form that has the text boxes and the name of the textbox were indicated):

: [forms]![NameofYourForm]![NameofYourTextBox].[value]
 
That worked great CPOD, Now one step farther.
What if the info I want to get the value from is a combobox?
I tried the same methodology with your first answer and it queryed a square box. There are 2 columns in my combo box. How do I define which value to get?

Thanks, Stevegr
 
You can use a little Visual Basic to put the value into another textbox on your form and then call for the value in that textbox in your query.

Add another textbox to your form (It doen't have to be visable. You can turn the visable property to false in the textbox's property list).

In the combobox's afterupdate event put code something like this:

Me!NewTextboxName = Me!ComboName.Column(1)

The column number (1) indicates which column value to put in the textbox. Column numbers start at 0 (0,1,2,3 .......)

Then in your query reference the new textbox:

forms!YourFormName!NewTextBoxName
 

Users who are viewing this thread

Back
Top Bottom