|
Hi All
I am working on VB6 with CR8, in my application i have a save button that will save the data into database and then print a invoice. the data entered is works perfectly the problem is in the report.
When the report prints it always print the half content means it should print 10 records but it always prints the 6 or 7 records. In my query in uses the grouping but the data belongs to the first group will prints only.
Another problem is if i place a msgbox before invoice genration then it prints the invoice correctly
so what would the solution
plz reply
With Regards
Yogesh Agarwal
|
|
|
|
|
hi all,
recently i have developed an application in vb6 (sp6).
when i run this application all is ok but when i want to take print out of given subject it gives me some problems
when i take printing on domatrix printer it gives me ok result, i mean to there is no problem with such like proble on any other pc.
but, when i same take on laserjet printer it gives varied result, mean on some pc it suppoted and on some pc i could not able take the print out.
kindly help me.
thanks in advance.
rmshah
Developer
|
|
|
|
|
what code you are using to take a print out and what port you are using to connect your print to your machine
Yogesh Agarwal
|
|
|
|
|
thanks, find the coding which i used to take printout
Private Sub DataRptRecord()
'On Error Resume Next
Dim Var1, Var2 As String
If A_DataEnvironment.rsCmdPrnt.State Then A_DataEnvironment.rsCmdPrnt.Close
A_DataEnvironment.rsCmdPrnt.Open ("SELECT *From adrsmstr",conn)
DataRptAddress.Sections(2).Controls("lbl1").Caption = Trim(TxtCntact1.Text) ' AdrsBook_DataEnvironment.rsCmdAdrsPrnt.Fields(1)
DataRptAddress.Show
' the following section of codes deals with only dos base printings.
Private Sub DosBasePrinting()
On Error Resume Next
Dim A1, A2, A3, A4, A5, A6, A7 As String
Dim z As Integer
Dim i As Integer
If MarkAtt = True Then
Call AskForSave
If a.State Then a.Close
a.Open ("SELECT * From adrsmstr"), Conn, adOpenStatic, adLockBatchOptimistic
If a.EOF = False Then
a.MoveFirst
z = PrntNos
Open App.Path & "\A.TXT" For Output As #1
A1 = a.Fields(1)
A2 = a.Fields(0)
A3 = a.Fields(2)
A4 = a.Fields(3)
A5 = a.Fields(4)
A6 = a.Fields(6)
A7 = a.Fields(5)
For i = 1 To z
Print #1, " " & Trim(TxtCntact.Caption)
Print #1, " " & A2
Print #1, " " & UCase(Trim(A3)) & "," & UCase(Trim(A4))
Print #1, " " & A5
Print #1, " " & A6
Print #1, " " & A7
Print #1, " "
Print #1, " "
Print #1, " "
Next
Close #1
End If
X = Shell(App.Path & "\print.bat", vbHide)
rmshah
Developer
|
|
|
|
|
Hello,
Is somenone know a way how to add a table in richtextbox in vb.net 2005 without rtf property usage?
Thanks for help
Shay Noy
|
|
|
|
|
|
hi all,
i want to insert values into milti cells with multi rows in vb.net.
i am new to datagridview.
kindly help me.
thanks
rmshah
Developer
|
|
|
|
|
Sounds like you need to buy a book and work through it. I really can't work out the specifics of your problem but it sounds like you're asking for something that is easily researched online, or found in books.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
use teh following code
<br />
<br />
DataGridView1.Rows(x).Cells(y).Value = "Hello"<br />
<br />
Here use the loop to control x and y
and use DataGridView1.Rows.Add to add new row
Yogesh Agarwal
|
|
|
|
|
thanks for your support.
further help me how to navigate between colums and how can i handle the events.
thanks again
rmshah
Developer
|
|
|
|
|
Hi
You could use the code :-
<br />
dim i as integer<br />
<br />
for i=0 to DataGridView1.ColumnCount-1<br />
<br />
<the code=""><br />
<br />
next<br />
<br />
</the>
Now i is your variable to navigate on columns, to handle the events most of the event handles has the colindex and rowindex property to determines the column and row you use like if i talk about the celcontentclick event the default event for datagridview then: -
<br />
<br />
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick<br />
<br />
<br />
if e.ColumnIndex = 0 Then<br />
<br />
<some code=""><br />
<br />
End If<br />
<br />
<br />
<br />
End Sub<br />
<br />
</some>
Yogesh Agarwal
|
|
|
|
|
hello!
i've created a small mdi sofware and.to open a child form a user should click on the menu item corresponding.Even if the same form is already openned when i click on the same menu item it opens again the ssame form which is not logical.How can i prevent the form to be openned more than once.thanks
eager to learn
|
|
|
|
|
I haven't work in VB for a while, so I apologize if my syntax is off. What you should do is something along the lines of:
<br />
Dim myForm as New Form1()<br />
<br />
myForm.Show()<br />
|
|
|
|
|
Hi J$
Your code do the same thing, and the problem remains same do this
<formname>.show
did not create the new object for the form else ti will display the form again and again
With Regards
Yogesh Agarwal
|
|
|
|
|
|
Create a object of the form (probably in a module)-
For e.g
Dim objfrm1 as Form1
Now, on click event of the context menu (or button) write the following code -
if isnothing(objfrm1) then
objfrm1 = new form1
objfrm1.MdiParent = me
objfrm1.show()
else
objfrm1.focus()
end if
Also, do not forget to set the obj to nothing on the form closing event.
I mean, on CLOSING event of form1 write the followng code.
objfrm1 = nothing
Worring about losing keeps me WINNING>>..
|
|
|
|
|
hi i've tried the suggestoin of Sachin Gokhale and he's right.I found it so easy and i was wondering why i couldn't find it myself.Thanks man
eager to learn
|
|
|
|
|
Hi
try this
dim frm as form1
frm.showdialogue(me)
this wont let the user work with anything other form, until this form closes!
hope this helps...
|
|
|
|
|
ok thanks will try different suggestion here and tell which is cool.Thanks again guys!
eager to learn
|
|
|
|
|
I found this information howto get from Interent Exlorer_server
<br />
Option Explicit<br />
'A demonstration on how to get the Yahoo Chat or PM HTML or Text<br />
'Based on Get YM! Chat Text & HTML from "Internet Explorer_Server" object By: James Johnston<br />
'I cleaned up his method for ease of use, and also reduced the amount of code by 1/10th<br />
'I added the last line and got rid of the extra scroll bar in the HTML version<br />
'Now, I can go back to makin chat bots >:)<br />
'c0ldfyr3 www.EliteProdigy.com<br />
<br />
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long<br />
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long<br />
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long<br />
Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long<br />
Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long<br />
Private Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, lParam As Any, ByVal fuFlags As Long, ByVal uTimeout As Long, lpdwResult As Long) As Long<br />
Private Declare Function ObjectFromLresult Lib "oleacc" (ByVal lResult As Long, riid As UUID, ByVal wParam As Long, ppvObject As Any) As Long<br />
Private Const SMTO_ABORTIFHUNG As Long = &H2<br />
Private Const GW_HWNDFIRST As Long = 0<br />
Private Const GW_HWNDNEXT As Long = 2<br />
Private Const GW_CHILD As Long = 5<br />
Private Type UUID<br />
Data1 As Long<br />
Data2 As Integer<br />
Data3 As Integer<br />
Data4(0 To 7) As Byte<br />
End Type<br />
Private Type typWindows<br />
ClassName As String<br />
hWnd As Long<br />
End Type<br />
Private Type typWinFinal<br />
ChildWindows() As typWindows<br />
Count As Integer<br />
End Type<br />
Public Type YIMType<br />
Text As String<br />
HTML As String<br />
End Type<br />
Public Const c_ChatStyle As String = "<style>" & vbCrLf & _<br />
".sendername { font-size:10pt;font-family:Arial;font-weight:bold;color:#000000;text-decoration:none };" & vbCrLf & _<br />
".recvername { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF;text-decoration:none };" & vbCrLf & _<br />
".ymsgrname { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000;text-decoration:none };" & vbCrLf & _<br />
".chatusername { font-size:10pt;font-family:Arial;color:#FF0000;text-decoration:none };" & vbCrLf & _<br />
".usertext { font-size:10pt;font-family:Arial; };" & vbCrLf & _<br />
".redstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000;text-decoration:none };" & vbCrLf & _<br />
".greenstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#008800;text-decoration:none };" & vbCrLf & _<br />
".graystatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#888888;text-decoration:none };" & vbCrLf & _<br />
".chatrecver { font-size:10pt;font-family:Arial;font-weight:bold;color:#880000;text-decoration:none };" & vbCrLf & _<br />
".chatsender { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF;text-decoration:none };" & vbCrLf & _<br />
".chataction { font-size:10pt;font-family;Arial;color:#880088;text-decoration:none };" & vbCrLf & _<br />
"a { color:#0000FF; };" & vbCrLf & _<br />
"p { text-indent:-7;margin-left:10;margin-top:0;margin-bottom:0 };" & vbCrLf & _<br />
"</style>"<br />
Public Const c_PMStyle As String = "<style>" & vbCrLf & _<br />
".sendername { font-size:10pt;font-family:Arial;font-weight:bold;color:#000000; }" & vbCrLf & _<br />
".recvername { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF; }" & vbCrLf & _<br />
".ymsgrname { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000; }" & vbCrLf & _<br />
".usertext { font-size:10pt;font-family:Arial; }" & vbCrLf & _<br />
".redstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000; }" & vbCrLf & _<br />
".greenstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#008800; }" & vbCrLf & _<br />
".graystatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#888888; }" & vbCrLf & _<br />
".imvnotify { font-size:10pt;font-family:Arial;font-weight:bold;color:#000088; }" & vbCrLf & _<br />
"a { color:#0000FF; }" & vbCrLf & _<br />
"p { text-indent:-7;margin-left:10;margin-top:0;margin-bottom:0 }" & vbCrLf & _<br />
"</style>"<br />
<br />
Public Function GetClassN(ByVal hWnd As Long) As String<br />
Dim ParentClassName As String<br />
Dim Z As Long<br />
ParentClassName = String(100, Chr(0))<br />
Z = GetClassName(hWnd, ParentClassName, 100)<br />
GetClassN = Left(ParentClassName, Z)<br />
End Function<br />
Private Function GetChildWindows(hWnd As Long) As typWinFinal<br />
Dim ChildP As Long<br />
Dim LastChild As String<br />
Dim MainP As Long<br />
Dim WinDetails As String<br />
Dim First As Boolean<br />
Dim AdWin As Long<br />
<br />
GetChildWindows.Count = -1<br />
MainP = GetWindow(hWnd, GW_CHILD)<br />
ChildP = GetWindow(MainP, GW_HWNDFIRST)<br />
Do While ChildP <> 0<br />
ChildP = GetWindow(ChildP, GW_HWNDNEXT)<br />
If ChildP = 0 Then Exit Do<br />
WinDetails = GetClassN(ChildP)<br />
<br />
GetChildWindows.Count = GetChildWindows.Count + 1<br />
ReDim Preserve GetChildWindows.ChildWindows(GetChildWindows.Count)<br />
<br />
With GetChildWindows.ChildWindows(GetChildWindows.Count)<br />
.ClassName = WinDetails<br />
.hWnd = ChildP<br />
End With<br />
DoEvents<br />
Loop<br />
End Function<br />
Public Function GetIMText() As YIMType<br />
Dim IMClass As Long<br />
Dim MidWin As Long<br />
Dim InternetExplorerServer As Long<br />
Dim Something As typWinFinal<br />
Dim X As Integer<br />
Dim sTmp As String<br />
Dim yTmp As YIMType<br />
<br />
'Loop through all the windows finding their handles from predefined classnames.<br />
IMClass = FindWindow("imclass", vbNullString)<br />
Something = GetChildWindows(IMClass)<br />
For X = 0 To Something.Count<br />
sTmp = Something.ChildWindows(X).ClassName<br />
If Len(sTmp) > 4 Then<br />
If StrComp(Left(sTmp, 3), "atl", vbTextCompare) = 0 Then<br />
InternetExplorerServer = FindWindowEx(Something.ChildWindows(X).hWnd, 0&, "internet explorer_server", vbNullString)<br />
yTmp = GetIEText(InternetExplorerServer)<br />
If InStr(1, yTmp.HTML, "function RestoreStyles()") > 0 Then<br />
GetIMText = yTmp<br />
End If<br />
End If<br />
End If<br />
Next<br />
End Function<br />
Private Function GetIEText(ByVal hWnd As Long) As YIMType<br />
Dim doc As IHTMLDocument2<br />
Dim col As IHTMLElementCollection2<br />
Dim EL As IHTMLElement<br />
Dim l As Long<br />
Dim v1 As Variant<br />
Dim v2 As Variant<br />
Set doc = IEDOMFromhWnd(hWnd)<br />
'Pass the data back through the function<br />
On Error GoTo Ender:<br />
GetIEText.Text = doc.body.innerText<br />
GetIEText.HTML = doc.body.innerHTML<br />
Exit Function<br />
Ender:<br />
GetIEText.Text = "No Chat Or Pm Open ?"<br />
Err.Clear<br />
End Function<br />
Private Function IEDOMFromhWnd(ByVal hWnd As Long) As IHTMLDocument<br />
Dim IID_IHTMLDocument As UUID<br />
Dim hWndChild As Long<br />
Dim spDoc As IUnknown<br />
Dim lRes As Long<br />
Dim lMsg As Long<br />
Dim hr As Long<br />
If hWnd <> 0 Then<br />
'If the Handle is not 0, that means if the window is open .........<br />
'We tell windows we are going in for the kill, and grabbing the data<br />
lMsg = RegisterWindowMessage("WM_HTML_GETOBJECT")<br />
Call SendMessageTimeout(hWnd, lMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, lRes)<br />
If lRes Then<br />
With IID_IHTMLDocument<br />
.Data1 = &H626FC520<br />
.Data2 = &HA41E<br />
.Data3 = &H11CF<br />
.Data4(0) = &HA7<br />
.Data4(1) = &H31<br />
.Data4(2) = &H0<br />
.Data4(3) = &HA0<br />
.Data4(4) = &HC9<br />
.Data4(5) = &H8<br />
.Data4(6) = &H26<br />
.Data4(7) = &H37<br />
End With<br />
hr = ObjectFromLresult(lRes, IID_IHTMLDocument, 0, IEDOMFromhWnd)<br />
'We pass the data back from the function.<br />
End If<br />
End If<br />
End Function<br />
<br />
<br />
Public Function GetIMWindowText(lWindow As Long) As YIMType<br />
Dim IMClass As Long<br />
Dim MidWin As Long<br />
Dim InternetExplorerServer As Long<br />
Dim Something As typWinFinal<br />
Dim X As Integer<br />
Dim sTmp As String<br />
Dim yTmp As YIMType<br />
<br />
'Loop through all the windows finding their handles from predefined classnames.<br />
'IMClass = FindWindow("imclass", vbNullString)<br />
Something = GetChildWindows(lWindow)<br />
For X = 0 To Something.Count<br />
sTmp = Something.ChildWindows(X).ClassName<br />
If Len(sTmp) > 4 Then<br />
If StrComp(Left(sTmp, 3), "atl", vbTextCompare) = 0 Then<br />
InternetExplorerServer = FindWindowEx(Something.ChildWindows(X).hWnd, 0&, "internet explorer_server", vbNullString)<br />
yTmp = GetIEText(InternetExplorerServer)<br />
If InStr(1, yTmp.HTML, "function RestoreStyles()") > 0 Then<br />
GetIMWindowText = yTmp<br />
End If<br />
End If<br />
End If<br />
Next<br />
End Function<br />
does anyone have example how to set some html tag into interent Explorer_server?
thank you much
|
|
|
|
|
VB_Crazy wrote: interent Explorer_server
What's an "interent Explorer_server"??
You might want to be a bit more specific about what you want to do. Put a tag into what??
|
|
|
|
|
Internet Explorer_Server is what yahoo messenger use for
chat text class name
i'm trying to add some html tag and information into that
notice myself only.
|
|
|
|
|
No one have idea how to work this?
|
|
|
|
|
i want to encrypt my database which is in access. I linked access with vb6...help with the encrption
|
|
|
|
|
OK. Open Access, go to the Tools menu, click on Security, then click on Encrypt/Decrypt database. Pick the database you want to encrypt, then give the encrypted copy a filename.
|
|
|
|
|