Search results

  1. F

    Errors when trying to execute query

    I was playing with this code a bit, and the problem is that you don't need fields in rst!Fields. However, it only displays one result of the query, when there should be four or more. Any idea on how to display the entire result? The MoveNext doesn't seem to be working.
  2. F

    Errors when trying to execute query

    I just tried using your fixes and got the same error. "Item not found in this collection" and it occurs on line: xstr = rst!Fields("[Dept Root Source]") I swear this field exists!
  3. F

    Errors when trying to execute query

    These are the two procedures that work with each other. The values for list20.value obviously come from the value of the listbox which is referencing information from a different table. That part was way easier! here we go: Private Sub Command22_Click() Dim strEmail, strBody As String Dim...
  4. F

    Errors when trying to execute query

    So this may be working once I tweak all the little stupid mistakes I'm making. As a test, I used this return field: xstr = rst!Fields([Dept Root Source]) Which gives me an error of "Item not found" Also, this is a 101 question, but when I call the sub, I call Call Thepercent, correct?
  5. F

    Errors when trying to execute query

    The error occurs on: Set DB = CurrentDb They all will be strings. It's only text being sent.
  6. F

    Errors when trying to execute query

    I made all the changes, but am getting a type mismatch error. I researched this, and it seems as though it's because I'm not referencing the DAO library, but when I go to add the reference, it's saying I can't because it conflicts with another. Any ideas on why I'd get this error? Edit: It's...
  7. F

    Errors when trying to execute query

    But the problem is I'll need to return more than one field per record because I'm posting a break down of all the the percentages. What you're suggesting will only display one return. I need all the returns associated with the variable. So say there are 4 different records. Department name1...
  8. F

    Errors when trying to execute query

    So with Dlookup, is it possible to display all the rows being called? I think it just displays one, no? Here is what I'm using it for: Each department in my group has made billing errors, and I've ran queries that have broken down what each problem was in the department by percentage. I've done...
  9. F

    Errors when trying to execute query

    To answer your question: Because I'm very new to all of this, and I started out believing that I would need to use a function to return a value. Let me try what you're doing, and I'll report back. Thanks for all your help so far!
  10. F

    Errors when trying to execute query

    Now I'm getting an object required error Here's the code I'm calling in my email body: Function thepercent() As String Dim DB As DAO.Recordset Set DB = CurrentDb Set thepercent = DB.OpenRecordset("SELECT converttopercent.[Dept Root Source] FROM converttopercent WHERE [converttopercent].[Dept...
  11. F

    Errors when trying to execute query

    The data type for converttopercent.[dept root source] is text. I want to query that field with the value of what's in the listbox and then display the results in an email. I want to break down certain departments and then display the information in a query when the user selects which department...
  12. F

    Errors when trying to execute query

    I know I'm doing something wrong, but I'm trying to insert the results of a query, where the value of the query comes from a listbox into an email. To first test my query I am using this line: thepercent = db.OpenRecordset("SELECT converttopercent.[Dept Root Source] FROM converttopercent WHERE...
  13. F

    Instr Help

    I think I solved my issue. I created conditional statements that each search for the specific string. I thought there may be an easier way, but nope!
  14. F

    Instr Help

    I'm trying to code something that scans for different files and automatically opens them. For example: 99 times out of 100, the file is going to be a pdf, so I made this code: OID = IeApp.Document.body.innerHTML OIDLEFT = Mid(OID, InStr(1, OID, "oid") + 4, 9) 'this scans the source code for a...
  15. F

    Using VBA to click a link on a page

    I just wanted to bump this to see if anyone had any ideas as to why the element.click would open a browser that immediately crashes.
  16. F

    Using VBA to click a link on a page

    It's funny you linked that site. I use that script for another part of my application I'm using (and I will be using it with this part too). For anyone who needs to automate the Save As/ Open features with hwind, that is an awesome script. I just need to be able to click this stupid link...
  17. F

    Using VBA to click a link on a page

    I adjusted my code a bit, and now it at least finds the link: Private Sub Text282_Click() Dim IeApp As InternetExplorer Dim sURL As String Dim IeDoc As Object Dim Element As HTMLLinkElement Set IeApp = New InternetExplorer IeApp.Visible = True sURL = "link" IeApp.navigate sURL Do Loop Until...
  18. F

    Using VBA to click a link on a page

    Hello: I am trying to figure out the best way to automate the click of a link. Basically what I want is to open the browser to a specific page and search for a pdf file (which is named arbitrarily) and click on it. What I have here: Dim IeApp As InternetExplorer Dim sURL As String Dim IeDoc...
  19. F

    Importing Txt file issue. Need help!

    SUCCESS! You are a friggin genie wizard person!
  20. F

    Importing Txt file issue. Need help!

    Understood. I'm using this now: Dim i As Integer Dim strPathAndFile As String Dim strHold As String Dim strSQL As String strPathAndFile = "P:\test1.txt" i = FreeFile Open strPathAndFile For Input As #i Do Until EOF(i) Line Input #i, strHold strSQL = "Insert INTO Master ([testfield]) Values (" &...
Back
Top Bottom