Found another solution. Added a CustNumID field on the ReportSelectorForm then had the code populate that field from the loop. Now I can reference that field on the form as my query criteria. Here is the updated code:
Private Sub Command32_Click()
Dim rs As DAO.Recordset
Dim db As Database...
Starting to get over my head, now....
In my first query (in Design View), isn't there something I can put in the Criteria to reference back to the iCustNumID that the loop is on?
Something like the SQL equivilent of this (which doesn't work):
((ManualInput.CustNumID)=[rs]![iCustNumID]))
Thanks Remou - I've modified your code to the following (had to change some of the field names from my original post):
Private Sub Command32_Click()
Dim rs As DAO.Recordset
Dim db As Database
Dim iCustNumID As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("ManualInput")
Do While Not...
It actually does a series of create table queries to calculate a running points total based on gross profit. Right now, it launches the macro to run the queries based on a drop down selection of that customer number on a form. I don't have access to the code from this computer.
Fairly new to VBA coding. I have a table called tblManualInput that contains up to 300 customer addresses with a unique customer # for each (field name is CustNum).
I have an update query (qryUpdateTotals) I want to run for each CustNum in the ManualInput table once a new spreadsheet of...
Revisiting thread605-1353118 :
I've tried setting up a rule to notify me when an email is sent to an additional mailbox that I am monitoring from my Outlook 2003, but the rule does not take the assigned actions.
Is there anything else we can do?
Thanks,
Don
The Import External Data in Excel worked - thanks!
Still annoyed that the RunCommand / OutputToExcel in Access treats blank cells the way it does. Now I have to create a macro in Excel to set up the Import query on all of my associates' PCs...
Thanks for your help,
Don
Swi,
I tried your code but I get this error message:
Run-time error '-2147467259 (80004005)':
The database has been placed in a state by user 'Admin' on machine '[computer name]' that prevents it from being opened or locked.
When I click Debug, it goes to the Open statement of the code...
When I use the following Macro command:
RunCommand / OutputToExcel
It copies the data to Excel, and any blank cells appear to be blank however, when you use the End key plus the down arrow key to move to the next blank cell, it brings you to the bottom of the column. This leads me to believe...
Let's say you have a column with 100 rows of data and there are numerous blank cells within the column. When you press End then Down (or Ctrl+Down) in Excel, normally the cursor moves to the next blank cell in the column. In this case, it moves the cursor to the last cell of data in that...
When I use the following Macro command:
RunCommand / OutputToExcel
It copies the data to Excel, and any blank cells appear to be blank however, when you use the End key plus the down arrow key to move to the next blank cell, it brings you to the bottom of the column. This leads me to believe...
OK - I've incorporated the suggested WHERE clause from Golom's post but now I'd like the query check for two additional criteria fields from the input form - Total and Variance. How would I word the WHERE clause in include these extra two variables? Here is the corrected code that works when...
Have come to a road block in using criteria gathered from an input form to generate query results and narrowing the results using less than (<) and greater than (>) operators.
I want to allow the user to search for records that have an AVGCOST that is between the two values they enter on the...
Nevermind - I found the answer in the Access Forms thread:
Open the Properties window of the Form.
Select the command button you want.
Change the Default value to Yes.
Whenever Enter is pressed, this command button is activated.
Thanks!
We have an Access 2003 form with several fields and a command button which activates a macro to open a query. When you press tab or enter, it cycles through to the next field.
We would like to have it activate the command button when you press enter (so you don't have to go to each field)...
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.