Ok, thats perfect! What I was doing wrong was, rather than selecting a range like A1:A10, I assumed doing A:A was acceptible and it was giving me an error doing it that way. I guess thats because the two ranges have to be equal sizes? Whatever the reason, you all helped me out a lot. Thanks
But that gives me the product of the two different ranges doesn't it? I need it to count a range.
My actual spreadsheet is much larger this is just an example.
1 2
1 A B
2 A A
3 C A
Something like that, and i want to count the rows where the data in both columns...
Hmmm, not quite. Because the two sets of criteria are in different ranges. I want to count the number of rows that have "apples" in one column and "oranges" in a second column. I appreciate your input. Thanks.
I am trying to use the countif() function, however I need to specify 2 sets of criteria. Basically, I need to write something like
=CountIf(A1:A20,"Apples" and "Oranges")
I know what I wrote above wont work the way I have it, but is there anyway I can get the desired affect? Thanks.
Thanks a lot! You have helped me through pretty much all of my coding problems, and I can't thank you enough for helping out the beginners like myself.
I am trying to use vb code to specify a filter that a report is opened with. So strfilter is what I use in the docmd.openreport, however I can't figure out how the string is supposed to look. What I have is...
strfilter = strfilter & " tblData.[RR DATE] BETWEEN 10/31/'&Me.txtFiscalYear-1&' AND...
I use this code to export a query that the user selects into excel.
Private Sub btnSaveTo_Click()
Dim FilePath1, FileNamePath1, Dataexport
FilePath1 = LaunchCD(Me)
strName = lstQuery.Column(0)
If FilePath1 = "" Or IsNull(FilePath1) Then
Else
FileNamePath1 =...
Can anyone help me type this up right? The error I keep getting is "Error: Expected End of Statement" with the BETWEEN highlighted. Everything looks right to me, but I'm not very good with VBA. Thanks for any help.
DoCmd.OpenReport Me.lstReport, acViewPreview, , tblData.[GC DATE] BETWEEN Now()...
Sorry to post twice in a row, but this whole "thinking things through" thing is not my strong suit...
Would it make more sense to not use any lookup fields in the table at all, and just use them in forms when needed? or would that still create the same problems?
Well, I am a little confused because the relationships are all setup, and if I use SQL in a query to see those fields, the lookup still works. However when I use that exact same SQL in the rowsource, it is giving me what the field stored. Is there another way to write the SQL to make the lookup...
I am using code that to fill the rowsource of a listbox, however 2 of the fields that I am using are comboboxes that pull their lists from another table. So when the listbox displays it shows ID value rather than the value selected from the table. How would I set up the listbox to display other...
In the rowsource just use...
<code>
SELECT [MSysObjects].[Name] FROM MsysObjects WHERE (Left$([Name],1)<>"~") AND ([MSysObjects].[Type])=5 ORDER BY [MSysObjects].[Name];
</code>
There is FAQ that explains how to pull any of the objects into a listbox. faq181-690
Thanks a lot! That works perfectly.
...Just out of curiousity, I know how to make a multi-select list box of all the queries that I have. Is it possible to replace the part of code with the query name with the value from the list box? I think I know how to make that work if its possible only...
Thanks a lot! That actually works perfectly. I dont really even need the report. I just set up a few queries and export those. If you could tell me how to give the user the option of where to save the file that would be great. I would also like to know if its possible to set the font that the...
I dont need to export only the one record. I have a form that I use to set which filter I open this report with. Then I need to export the report into excel. I would like to set it up someway that I can export each report that I filter into a separate worksheet, or if I can set it up all in one...
Is there any way to export a form into Excel, and automatically format it a certain way? Or export 3 or 4 reports into one excel file as separate worksheets? Thanks for any help.
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.