hi
How to pass data to Template created in MS-Word from Visual Basic
Thanks
How to pass data to Template created in MS-Word from Visual Basic
Thanks
select * from table1 inner join table2 on table1.Id = table2.PID
select * from table1
select * from table2
UPDATE Customers SET FullName = Replace(FullName,"'","")
CN.Execute "UPDATE Customers SET FullName = Replace(FullName," ' ","")"
select * from table1 inner join table2 on table1.Id = table2.PID
select * from table1
select * from table2
fMain.Form.MinButton = True
fMain.Form.MaxButton = True
fMain.Form.Show
fMain.Form.StartUpPosition = vbStartUpScreen
fMain.Form.Show
Private Sub cmdVALL_Click()
Dim PQt, SQty, PQATot, AvAmt As Double
Dim strFREE As String
PQt = 0
SQty = 0
PQATot = 0
AvAmt = 0
ListView1.ListItems.Clear
Set rs = db.OpenRecordset("Select * From StockInOut ORder By ItemId")
PB1.Value = 0 'PB1 = ProgressBar1
PB1.Max = rs.RecordCount
strFREE = rs!ItemId
Do While Not rs.EOF
If Val(strFREE) = rs!ItemId Then
Dim lst As ListItem
Set lst = ListView1.ListItems.Add()
lst.Text = rs!ItemId
lst.SubItems(1) = rs!ItemNM
lst.SubItems(2) = rs!UnitNM
PQt = PQt + (rs!PQty + rs!PFreeQty)
SQty = SQty + (rs!BSQty + rs!BSFreeQty)
lst.SubItems(3) = PQt - SQty
lst.SubItems(4) = ""
lst.Tag = rs!ItemId
' PB1.Value = PB1.Value + 1
rs.MoveNext
Else
strFREE = rs!ItemId
PQt = 0
SQty = 0
PQATot = 0
AvAmt = 0
Set lst = ListView1.ListItems.Add()
lst.Text = ""
lst.SubItems(1) = ""
lst.SubItems(2) = ""
lst.SubItems(3) = ""
lst.SubItems(4) = ""
lst.EnsureVisible
End If
Loop
rs.Close
Set rs = Nothing
End Sub
sql = "select count(*) from LIST_DTL"
Set QDGRs = Cnn.OpenRecordset(sql)
RecCnt = QDGRs.RecordCount
txtQueryRecCnt.Text = "" & RecCnt
Set dgQueryRes.DataSource = QDGRs.DataSource
dgQueryRes.Refresh
sql = "select 5, 6"
Set QDGRs = Cnn.OpenRecordset(sql)
RecCnt = QDGRs.RecordCount
txtQueryRecCnt.Text = "" & RecCnt
Set dgQueryRes.DataSource = QDGRs.DataSource
dgQueryRes.Refresh
SetWindowPos Me.hWnd, -1, 0, 0, 0, 0, 2 Or 1
Public Function ForceForegroundWindow(ByVal hWnd As Long) As Boolean
Dim bAttached As Boolean, hWndFore As Long, App_ThreadID As Long, Fore_ThreadID As Long
hWndFore = GetForegroundWindow
If hWnd <> hWndFore Then
App_ThreadID = App.ThreadID
Fore_ThreadID = GetWindowThreadProcessId(hWndFore)
If App_ThreadID <> Fore_ThreadID Then
bAttached = AttachThreadInput(App_ThreadID, Fore_ThreadID, True) <> False
End If
Select Case True
Case SetForegroundWindow(hWnd) <> False, _
BringWindowToTop(hWnd) <> False, _
SetActiveWindow(hWnd) <> 0&, _
SetFocusOn(hWnd) <> 0&
ForceForegroundWindow = True
Case Else
SwitchToThisWindow hWnd
ForceForegroundWindow = (GetForegroundWindow = hWnd)
End Select
If IsIconic(hWnd) Then ShowWindow hWnd, 9 Else ShowWindow hWnd, 5
If bAttached Then
bAttached = AttachThreadInput(App_ThreadID, Fore_ThreadID, False) <> False
End If
Else
ForceForegroundWindow = True
End If
End Function
Public Declare Function MakeModal Lib "dsmodal.dll" (ByVal AppHwnd As Long, ByVal hwndDest As Long, Optional ByVal Beep As Long = 0) As Long
Call MakeModal me.hWnd, 1, 1
SetWindowPos Me.hWnd, -1, 0, 0, 0, 0, 2 Or 1
Public Function ForceForegroundWindow(ByVal hWnd As Long) As Boolean
Dim bAttached As Boolean, hWndFore As Long, App_ThreadID As Long, Fore_ThreadID As Long
hWndFore = GetForegroundWindow
If hWnd <> hWndFore Then
App_ThreadID = App.ThreadID
Fore_ThreadID = GetWindowThreadProcessId(hWndFore)
If App_ThreadID <> Fore_ThreadID Then
bAttached = AttachThreadInput(App_ThreadID, Fore_ThreadID, True) <> False
End If
Select Case True
Case SetForegroundWindow(hWnd) <> False, _
BringWindowToTop(hWnd) <> False, _
SetActiveWindow(hWnd) <> 0&, _
SetFocusOn(hWnd) <> 0&
ForceForegroundWindow = True
Case Else
SwitchToThisWindow hWnd
ForceForegroundWindow = (GetForegroundWindow = hWnd)
End Select
If IsIconic(hWnd) Then ShowWindow hWnd, 9 Else ShowWindow hWnd, 5
If bAttached Then
bAttached = AttachThreadInput(App_ThreadID, Fore_ThreadID, False) <> False
End If
Else
ForceForegroundWindow = True
End If
End Function
Public Declare Function MakeModal Lib "dsmodal.dll" (ByVal AppHwnd As Long, ByVal hwndDest As Long, Optional ByVal Beep As Long = 0) As Long
Call MakeModal me.hWnd, 1, 1