Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub ConnectToDatabase()
sDB = Application.GetOpenFilename("Access Databases (*.mdb), *.mdb")
If sDB <> False Then [ConnectString] = sDB
End Sub
Sub GetJobParameters()
Dim cnn1 As ADODB.Connection
Dim rst As Recordset
Dim strCnn As String
Dim varDate As Variant, sDB, lRow As Long, iCol As Byte
' Open a connection using the Microsoft Jet provider.
Set cnn1 = New ADODB.Connection
With cnn1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0"
.Open [ConnectString]
End With
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = cnn1
.CursorType = adOpenStatic
On Error Resume Next
.Open "select * from tblJobMaster where JobNbr=" & [JobNbr]
.MoveFirst
If Err.Number = 0 Then
[JobName] = .Fields("JobName").Value
[ContractorName] = .Fields("Contractor").Value
[ContractorAddress] = .Fields("Physical1").Value & " " & _
.Fields("Physical2").Value
[ContractorFaxPhone] = .Fields("ContrFax").Value & " / " & .Fields("ContrPhone").Value
Else
[JobName] = ""
[ContractorName] = ""
[ContractorAddress] = ""
[ContractorFaxPhone] = ""
End If
rst.Close
cnn1.Close
Set rst = Nothing
Set cnn1 = Nothing
End With
End Sub