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...
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...
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...
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...
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 & "';"
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
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
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"...
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 = ""...
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 =...
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
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...
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...
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...
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.