Search results

  1. F

    Adding Windows username in a new record?

    Hi Angelflower, How would I write the code to do that? The append query that I created is called UL Query. I'm not sure how to write it to tell the query to append the table. Thank you!
  2. F

    Adding Windows username in a new record?

    Contractor, Now, how do I append the table to include the username via the append query? Same goes for date and time.
  3. F

    Adding Windows username in a new record?

    Contractor, Should this be within the button click? Maybe that is what I am doing wrong. I believe that I have butchered the code. Haha Here is the updated code: Private Sub cmdFind_Click() On Error GoTo cmdFind_Click_Err Option Compare Database Option Explicit Private...
  4. F

    Adding Windows username in a new record?

    I have eliminated the notes that you had included and had not added any. The debugger points to this in regard to comments: Private Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
  5. F

    Adding Windows username in a new record?

    Paul, where exactly do I add the breakpoint? At the tmpDB.Execute line? It clears all of textboxes on the form when the "cmdFind" button is clicked (this was a decision by my management). Thanks for this, Contractor! I can't get this to work. I keep getting an error that comments need to be...
  6. F

    Adding Windows username in a new record?

    Paul, I set the form to unbound and no longer use the Me. for the date and time. Not sure if that will help my situation at all. The new functions for date and time: Public Function getTime() getTime = Format(Now(), "h:m:s") End Function Public Function getDate() getDate =...
  7. F

    Adding Windows username in a new record?

    A little background: This is to clear any textboxes: Combo99.Value = "" Combo89.Value = "" Combo71.Value = "" Combo55.Value = "" Combo85.Value = "" Combo212.Value = "" This is to close any open queries so that the new queries can be ran: For Each qry In CurrentDb.QueryDefs...
  8. F

    Adding Windows username in a new record?

    This is the updated code: Private Sub cmdFind_Click() On Error GoTo cmdFind_Click_Err Dim tmpDB As DAO.Database, qry As DAO.QueryDef Dim intCount As Integer Set tmpDB = CurrentDb Combo99.Value = "" Combo89.Value = "" Combo71.Value = "" Combo55.Value = ""...
  9. F

    Adding Windows username in a new record?

    I added the brackets accordingly, unfortunately nothing happens. I really appreciate all of your help so far!
  10. F

    Adding Windows username in a new record?

    Yes, that is exactly what I am trying to do. I have the append query and the table. Unfortunately, nothing is occurring when the button is clicked. Here is the updated code: Private Sub cmdFind_Click() On Error GoTo cmdFind_Click_Err Dim tmpDB As DAO.Database, qry As DAO.QueryDef Dim...
  11. F

    Adding Windows username in a new record?

    We want to track how often people are using the form. The form is setup like a search page and has a button that runs the queries for what they want to find. This is the same button that I want to call the functions: getWinUser & getDateTime. This is the code for the button, I'm not sure how to...
  12. F

    Adding Windows username in a new record?

    Hi JHB, I created the append query, is there anything that I need to add VBA wise? The table is not updating.
  13. F

    Adding Windows username in a new record?

    Hi, I am having a difficult time figuring out how to have a table add a new record that includes the Windows username of the user that clicks the button on my form. The function is in place that pulls the Windows username: Public Function getWinUser() As String getWinUser =...
  14. F

    Export query to text file with specific formatting?

    Update: I have modified my VBA to open the corresponding VBScript. Is there a way that the VBScript could pull the IP address from the Access form that the user is searching?
  15. F

    Export query to text file with specific formatting?

    Hi Pat, I have a VBScript that does exactly what I need it to do that is completely outside of the database. Is there a way that I could use the VBA to open and run that script? In other words, what VBA code would I use to open it?
  16. F

    Export query to text file with specific formatting?

    Hi, I have successfully put together some VBA code that will accept a user's input into a textbox on a form. A cmdFindprinter button is clicked and the query is ran. The user is asked via an inputbox for their login ID so that the query is exported to a text file on the desktop. The query then...
  17. F

    Code to auto-export query record/row to text file

    Okay, so I've made some serious strides so far. This is the updated code that now works with the textbox and cmdFindprinter button: Private Sub cmdFindprinter_Click() On Error GoTo Err_Handler Dim strPath As String strPath = InputBox("Enter file path", , "C:\Users\blankn\Desktop\Test.txt")...
  18. F

    Code to auto-export query record/row to text file

    Here is the result of a search of the IP listed above:
  19. F

    Code to auto-export query record/row to text file

    Hi CJ, I apologize, I have not gotten the sample for you, however, I have found a bit of code that kind of does what I need: Private Sub cmdFindprinter_Click() On Error GoTo Err_Handler Dim strPath As String strPath = InputBox("Enter file path", , "C:\Users\public\Desktop\Test.txt") If...
  20. F

    Code to auto-export query record/row to text file

    Correct, I am copying more than one field from the query. Also, I don't need all of the fields, only a few. I'll try to provide some sample data later.
Back
Top Bottom