I have an array called myArray(3).
It's values are myArray("12", "5", "12", "35")
I want to copy each value into a cell on a spreadsheet. Usually I do something like this:
i=0
Do while i < 4
Range("A1").Offset(0, i).Formula = myArray(i)...
I do a macro on a selected range, but it errors out if the range contains no data.
What's the appropriate error checking to do to allow me to put an error message in?
Thanks.
I save a worksheet as an .xla file to be used as an add-in. In the worksheet, I've created a custom toolbar (and named it). However, when someone else tries to use my add-in, they get the code behind it, but not the toolbar. How do I get the toolbar to work?
Do I have to code it? If so, how...
I have the following command in my code:
DoCmd.OutputTo acOutputForm, , acFormatXLS
It allows me to export the forms data to Excel. A standard Microsoft window pops up with the directories, so I can save the file.
However, if I "Cancel" at that time, my original form returns an...
Here's my insert into statement:
INSERT INTO tbl_2002YTDAmounts_V2
SELECT [GL_data].[VendorName] AS VendorName, [GL_data].[PS_Num] AS PS_Num, [GL_data].[VendorID] AS VendorID, [GL_data].[GL_Num] AS GL_Num, sum([GL_data].[2002YTDAmount]) AS 2002YTDAmount
FROM GL_data
GROUP BY [GL_data].[GL_Num]...
Thanks for the advice.
I ended up doing something different. I build a form that returned results from a query. This way when I opened the form I could pass in a where clause that I built from the main form. On the subform open event I inserted:
DoCmd.OutputTo acOutputForm, , acFormatXLS...
What's the best way to export data to excel from a form...
Here's my situation:
Main form user presses a button. This button should export the results of a query to excel. However, the query uses parameters built in the main form (from listbox, textboxes, etc.)
I have a multi-select listbox. On the listbox_click event I want to do an If statement to see if a particular row was the one most recently selected.
Is that possible? Right now, I can only figure out how to tell if it is selected at all, not if it's the one most recently clicked.
Thanks.
That was just a typo. It should be Northeast, Pacific, Southeast. As for the ASC and DESC, I just built that into the following command:
Me.OrderBy = Forms![frm_Results]![cbox_SortOrder] & " DESC"
Try this...make sure the report already runs fine without your where statement. You're just adding that part in here. Put this code (after replacing the appropriate values) into your command button click event on the form.
Dim stDocName As String, sqlwhere As String
sqlwhere =...
I got it to work. Didn't need to disable any groupings.
One last question. How can I make it sort by either ascending or descending in this example?
Thanks.
I need the grouping in the design view the report should look like this:
Division
Pacific
Vendor 1 $50
Vendor 2 $65
Northeast
Vendor 3 $72
Vendor 4 $35
Southeast
Vendor 5 $56
Vendor 6 $12
Vendor 7 $23
The report should be grouped...
I have a report that I want the user to be able to run from a form and select a sort order from a combo box.
Currently I use an If statement to check which value is chosen from the combo box.
I have 3 versions of the same report:
rpt_Test_SortByX
rpt_Test_SortByY
rpt_Test_SortByZ
So, based...
I have a rather complex SQL that is used to build/run a report. Part of the where clause I need to build in VB because it uses multiple rows from a multi-select listbox.
Can I only build that part of the where clause in VB and build the rest of the query in Design mode and somehow link the two...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.