Search results

  1. B

    VBA: Trying to Close Workbook, nothing happens

    Why not simply use: Wb.Close
  2. B

    Count Dup based one Mulitple Criteria

    Actually, you would create a modified version of the query, something like the following: SELECT T1.EmpID, Count(*) AS CallDateCount FROM ( SELECT DISTINCT EmpID, Cust_ID, Call_Dt FROM MyTable WHERE Call_Channel = 'F2F') AS T1 GROUP BY T1.EmpID;
  3. B

    Count Dup based one Mulitple Criteria

    You can try something like the following (substitute highlighted text with actual table/field names): SELECT T1.EmpID, Count(*) AS CallDateCount FROM ( SELECT DISTINCT EmpID, Cust_ID, Call_Dt FROM MyTable) AS T1 GROUP BY T1.EmpID;
  4. B

    Comparing data from one field to several others

    You can use a cartesian join, with something like the following: SELECT TableA.*, TableB.* FROM TableA, TableB WHERE TableA.Name = TableB.Field1 OR TableA.Name = TableB.Field2; NOTE: This is not the most performance-friendly option for tables with extremely large amounts of data, but for...
  5. B

    Views

    Let's say your two tables are tblPerson and tblItem, and let's say the joining field is PersonID. Finally, let's say that you are trying to create a view of tblItem, with some related information from tblPerson. In that case, your query would probably be something like the following: SELECT...
  6. B

    RunTime Error 424 : Object Required

    You might try the following addition (highlighted in Blue): sqry = _ "INSERT INTO tblVendorPerformance (ProjectRefNum, VendorID, TotalProjectCost, FixedProjectCost, Notes) " & _ "VALUES ('" & inputAddVendorPerformanceProject.Value & "', " & inputAddVendorPerformanceVendor.Value & ", " &...
  7. B

    How to remove runtime background

    You will need code in your popup form to hide the main application window. You will then need to set a reference to the popup form, either through the Startup > Display Form/Page option, or by use of an Autoexec macro using the OpenForm action. At the top of your popup form's code, you will...
  8. B

    Archive Database query

    You might try something like the following: SELECT T1.[File Name], MAX(T1.[Date of Birth]) AS [Date of Birth] FROM [Scott Corridor Archive Table] AS T1 GROUP BY T1.[File Name] HAVING MAX(T1.[Date of Birth]) <= #15/12/1986#;
  9. B

    Deleting values in an Array

    Have you tried the original solution I proposed to see if it works for you? Set rst = CurrentDb.OpenRecordset( _ "Select * from dbo_ProductStructure where ChildProductNbr Like '*" _ & txtPartNumber & "*'") 'search associated fields with user input ' Reset the Array i = 0 ReDim Arr(i)...
  10. B

    Deleting values in an Array

    Hello, ECEstudent, Please do the research I suggested before posting any more such questions. There is a plethera of information online, searchable through Google, on how ReDim and ReDim Preserve statements work, more than needs to be posted here. Doing this research will give you a much better...
  11. B

    Deleting values in an Array

    You should put the code before the statement: While rst.EOF = False As for what the code does, I suggest that you go onto Google and research the ReDim and ReDim Preserve statements more thoroughly to understand how they work. A good place to start would be here: ReDim Statement (Visual Basic)
  12. B

    Deleting values in an Array

    You could try: i = 0 ReDim Arr(i)
  13. B

    Checking ( adjusting ) screen resolutions ?

    Why not simply set the Form's AutoCenter property to Yes?
  14. B

    Selecting the last record from each customer before a certain date.

    You might try something like the following (substitute highlighted text with actual Table/Field names): SELECT Customer.CustomerID, MAX(Booking.DepartureDate) AS DepartureDate FROM Customer INNER JOIN Booking ON Customer.CustomerID = Booking.CustomerID GROUP BY Customer.CustomerID HAVING...
  15. B

    Rename summed field in a make table query?

    You can force the field name of your destination field by using the field name as the alias. If the SQL of your original query looks something like this: SELECT MyTable.Part, Sum(MyTable.Qty) AS SumOfQty INTO MyNewTable FROM MyTable GROUP BY MyTable.Part; You can change it to this: SELECT...
  16. B

    passing open args to a new form class

    Hello, lagbolt, For forms, your solution works, because you have the opportunity to call a Public Sub in the form instance subsequent to its instantiation. It is important to note, however, that the same can not be done with a Report instance; all related code in the report is executed and...
  17. B

    passing open args to a new form class

    You can't set the Form instance's OpenArgs, but you can use a Public Variable in the form to pass arguments to the specific form instance. In your module code declarations, place a statement like: Public gOpenArgs As Variant Then, your module code could read something like: gOpenArgs =...
  18. B

    SendKeys working incorrectly

    You might want to try the solution at the following link: API: Replacement for Sendkeys
  19. B

    VBA code to find cell on worksheet with matching value to form control value

    In your form's code, you can use something like: xlApp.ActiveSheet.Cells.Find(What:=Me.MyTextBox.Value, _ After:=ActiveCell, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _...
  20. B

    Case statement help

    In SQL-Server syntax: CASE WHEN T1.MyField = '0' THEN 'None' WHEN T1.MyField = '1' THEN 'One' ELSE 'Many' END ...in Microsoft Access, you can use the Switch function: Switch(T1.MyField = '0', 'None', T1.MyField = '1', 'One', True, 'Many')
Back
Top Bottom