Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by KarMac21

  1. KarMac21

    accounting for changes to system date

    Here's a function I use to sync the local pc's date/time with that of the server they are being authenticated to: Public Function SyncTime() Call Shell(Environ$("COMSPEC") & " /c NET TIME " & GetTimeServer & " /SET /Y ", vbHide) End Function Private Function GetTimeServer() As String...
  2. KarMac21

    run time error 3251 - object or provider not capable of performing...

    Hi Scroce, There are definitely easier ways to do this, such as an append query or a Docmd.RunSQL/Docmd.Execute statement with an "INSERT INTO" query. I only use ADO connections when Updating/Inserting/Gathering information from other data sources, such as SQL Server, DB2 Databases or other...
  3. KarMac21

    Array - How to check if array has no elements in it?

    I use the following function to determine if an array is empty or not: Public Function IsEmptyArray(tArray As Variant) As Boolean Dim lngElements As Long On Error Resume Next lngElements = UBound(tArray) IsEmptyArray = IIf(Err.Number = 0, False, True) Err.Clear...
  4. KarMac21

    run time error 3251 - object or provider not capable of performing...

    Try this: Public Sub addNewAuto() Dim strSQL As String Dim strPolID As String Dim datEffDate As Date Dim datExDate As Date Dim intAutoNum As Integer Dim strVehDescrip As String Dim strVin As String Dim cnADO As ADODB.Connection Dim rsADO As ADODB.Recordset strPolID = Me.txtPolID.Value...
  5. KarMac21

    SQL with function mid ?

    Also if CODENAME is a variable you will want to code it like this: SQL = "SELECT [T-LOOKUP-PAG].[PAG-ID], [T-LOOKUP-PAG].[PAG] " _ & "FROM [T-LOOKUP-PAG] " _ & "WHERE Mid([T-LOOKUP-PAG].[PAG],11,3) = '" & CodeName & "';"
  6. KarMac21

    SQL with function mid ?

    Hi Pat, You just have your mid in the wrong place. Try this instead: SQL = "SELECT [T-LOOKUP-PAG].[PAG-ID], [T-LOOKUP-PAG].[PAG] " _ & "FROM [T-LOOKUP-PAG] " _ & "WHERE Mid([T-LOOKUP-PAG].[PAG],11,3) = CodeName;" Shane
  7. KarMac21

    reference a forms control from a Public function

    Give this a shot: Public Function PAIS_Page1() As Boolean Dim frm as Form Set frm = Forms("YourFormName") If (IsNull(frm!Frame1001) Or frm!Frame1001 = 0) Then frm!Frame1001.tag = True Else frm!Frame1001.tag = False End If ... Shane
  8. KarMac21

    Updating a table in a linked database

    Hi Nimarri - Try this out Public Sub UpdateTables() Dim cn as New ADODB.Connection cn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=\\yourprojectpath\Database B.mdb" 'To update a record run this cn.execute "UPDATE Payments Set Field1=Value1, Field2=Value2 Where Somefield = somevalue"...
  9. KarMac21

    How to grab the current users UserName

    I use this code to retrieve that information: Imports System.Management Module User_Account_Info Dim Scope As Management.ManagementScope Dim Options As Management.ConnectionOptions Dim qry As ObjectQuery Public Function GetFullName(Optional ByVal strUserID As String = ""...
  10. KarMac21

    How to prevent duplicate apps running

    I use this code in my apps: Imports System.Diagnostics.Process Public Module GetInstanceCount() Public Sub Main() Dim Proc() as Process Dim ModuleName, ProcName as String ModuleName = Process.GetCurrentProcess.MainModule.ModuleName ProcName =...
  11. KarMac21

    Net Send or NetMessageBufferSend equivalent?

    I usually just cycle through an array of User Id's and use the following line to send network messages: For x = 0 To Ubound(aryUsers) Call Shell(Environ$("COMSPEC") & " /c NET SEND " & aryUsers(x) & " " & txtMessage.Text, vbHide) Next x Hope this works for you. Shane
  12. KarMac21

    Filling ASP fields from VB

    Thank you very much MrGreed!!!!!!! That did the trick.
  13. KarMac21

    Filling ASP fields from VB

    Hi all, I have a simple question (I hope). Is it possible to fill fields on an asp page from VB? For example: There is a website I visit daily and want to be able to enter my ID and Password in my vb program and have that prefill the webpage with the same info. If this possible? Thanks for...
  14. KarMac21

    How do I work with 2 Word Documents in Access?

    Try this: Dim oWord as New Word.Application Private Sub OpenDocs() Dim docFile1 as Document, docFile2 as Document Set docFile1 = oWord.Open("c:\File #1",,ReadOnly) Set docFile2 = oWord.Open("c:\File #2",,ReadOnly) 'Select which file you want active at the time...
  15. KarMac21

    Searching tables

    Give this a shot Abbyanu: If IsNull(DLookUp("Account ID","Accounts","[Account ID] = '" & Left(Me![Process ID], 2) & "'")) then MsgBox "Invalid Entity Process ID." Me![Process ID].SetFocus End If Enter this code into Either the LostFocus...

Part and Inventory Search

Back
Top