652 Posted Topics
Re: Hi, Unlike ListBox, u cant set the "Text" Property of a ComboBox, especially when its Style property is set to DropDown List. U have to loop thru the List Items and make it selected. Check this : [code] Dim i As Integer Dim str1 As String str1 =RS1.Fields(7) For i= … | |
Re: Hi Raghu, Add References Microsoft ActiveX Data Object Library 2.0 to ur project Connection To Oracle is : [code] Dim adoCn As New ADODB.Connection Dim sSQL as String Dim RST As New AdoDb.RecordSet sSQL= "Provider=MSDAORA.1;Password=MyPwd;" _ & " User ID=MyUserName;Data Source=MyDataSource;" _ & " Persist Security Info=True" With adoCn .CursorLocation … | |
Re: Hi, You want to get Total in a Single Query..? Is the Field in Access Table DateTime field or Single/Decimal field..? You can do it in a single query... Regards Veena | |
Re: Hi, Write This Code In Lost_Focus event of ComboBox:(Conn-> Connection object) DIm RST As New ADODB.RecordSet Dim sSQL As String sSQL = "Select * From MyTable Where RollNo = " & Val(Combo1.Text) RST.Open sSQL, Conn If Not RSt.EOF Then txtName.Text = RST("Name") txtAdd.Text = RST("Addr") txtAge.Text = RST("Age") Else txtName.Text … | |
Re: hI, Use "Microsoft Common Dialog Control " , add it from Projects>Components: "Microsoft Common Dialog Control 6.0" add it to form and in command Click : [code=vb] CommonDialog1.ShowOpen FileName = CommonDialog1.FileName [/code] Set "Filter" property to filter particular File extensions Regards Veena | |
Re: Hi, Use This Code: Repairs C:\DB1.mdb Dim TempStr As String Dim OrigStr As String OrigStr = "C:\DB1.mdb" TempStr ="C:\DBTemp.mdb" ' On Error Resume Next Kill TempStr DBEngine.RepairDatabase OrigStr, TempStr Kill OrigStr FileCopy TempStr, OrigStr Kill TempStr Msgbox "Repaired Successfully" Regards Veena | |
Re: Hi, Not sure, wht you are trying to do here..? You can simply Increase the Footer section to whatever size you want... REgards Veena | |
Re: Hi. Give this code from where u r stuck. MSComm1.Input Do DoEvents Buffer$ = Buffer$ & MSComm1.Input Loop Until InStr(Buffer$, "OK" & vbCrLf) ' Read the "OK" response data in the serial port. ' Close the serial port. MSComm1.PortOpen = False Regards Veena | |
Re: Hi Kehar, Check this : [url]http://visualbasic.ittoolbox.com/groups/technical-functional/vb-crystalreports-l/how-to-print-currency-in-words-1885844[/url] You need to create a New Formula for that.. Regards Veena | |
Re: Hi, [URL="http://www.activexperts.com/activsms/howto/gsm/vbnet/"]Check This[/URL] and also Download examples from the same site... REgards Veena | |
Re: Hi, Try This Code: [code=vb] Dim exel As Object Dim WBEx As Object Dim ExelWS As Object Dim appwd As Object Set exel = CreateObject("Excel.Application") Set WBEx = exel.Workbooks.Open("C:\Myexce.xls") Set ExelWS = WBEx.Worksheets("Sheet1") Set appwd = CreateObject("Word.Application") appwd.Visible = True appwd.Documents.Open FileName:="C:/doc1.doc" ExelWS.Range("A1:D20").Select Selection.Copy appwd.Selection.PasteSpecial Placement:=wdInLine, DataType:=wdPasteMetafilePicture appwd.Documents.Save Set appwd … | |
Re: Hi, if u want to get users response, create a new form(frmOptions) with all the options and show it in modal form, this way, frmOptions.Show 1 The Program Halts processing until u close the Modal frmOptions. Alternatively, u can give options in a Frame and show the frame, but u … | |
Re: Hi, What Code are you using to Insert Data in the FlexGrid...? Regards Veena | |
Re: Hi, Its always a Good Idea To Create a Seperate Database for each Financial year. Just copy the existing database as new one using "FILECOPY" and clear tables .. Regards Veena | |
Re: Hi, Declare this API at the top : [code=vb] Private Declare Function SHGetFolderPath Lib "shfolder.dll" _ Alias "SHGetFolderPathA" _ (ByVal hwndOwner As Long, _ ByVal nFolder As Long, _ ByVal hToken As Long, _ ByVal dwReserved As Long, _ ByVal lpszPath As String) As Long [/code] to Get the path … | |
Re: Hi, Comment the line causing average, as it is not necessary. Dim avg as Currency As Average need not necessarily be asn Integer. Regards Veena | |
Re: Hi, Try This : =Replace(FormatNumber(Sum(Fields!TotalProductPrice.Value),2),".",",") Or Change the Local/Regional settings in Control Panel. For Numbers, Give comma as DecimalSymbol. Regards Veena | |
Re: Hi, Why do you want to use "AppendChunk" for simple string..? Try This : nVNBR = "hi how are yodsf sdf" rsVen("BITS") =nVNBR rsVen.Fields("BITS_LENGTH") = 19 ' Or ' rsVen.Fields("BITS_LENGTH") =Len(nVNBR) rsVen.Update Regards Veena | |
Re: Hi, Open your Database like this : Set db = ws.OpenDatabase(App.Path & "\Masterfile.mdb", False, False, ";pwd=MyPassword") Regards Veena | |
Re: Hi, CheckListBox, Automatically Toggles between Check and UnCheck, you dont have to write the code in Click event. Remove all the Code and Check.. Regards Veena | |
Re: Hi, What I guess, is txtPrincipal has been created as a Part of the Control Array. If so, you will find some Numeric value in the "Index" property. Just Clear that, your code should work fine. Also Check the same for other controls as well.. Regards Veena | |
Re: Hi, Field Names which have SpecialCharacters/Spaces, need to be enclosed in a Square Bracket.. Try This : SQL = "Insert into Bookings(StaffID,RoomID,[Date required]," _ & " [Time required],[Additional requirements]) values('" _ & "'" & stafid.Text & "', " _ & "'" & rooid.Text & "', " _ & " #" … | |
Re: Hi, In Form_Load, just write this : (I guess "Whitebox", is the name of your Picturebox) Whitebox.Location.X() =32 Whitebox.Location.Y() =32 OR PictureBox1.Left = 32 PictureBox1.Top = 32 Regards Veena | |
Re: Hi, The error message seems to be clear, There is an "End If", without the "IF" condition. Just Check the code block pointed by the Compiler , Or post it here.. somebody here will help you. Regards Veena | |
Re: Hi, If Product Name is String, then Wrap it with Single Quotes : Try This : [code=vb] Set rs = Nothing Set rs = New ADODB.Recordset rs.Open "select materials.unit from Materials Where Materials.productname='" & Combo3.Text & "'", Con ' Rest of Coding Remains Same '[/code] Regards Veena | |
Re: Hi, Your Label is a a Control Array. So, Check the "Index" Property of the Label, and Change your code to, Say If Index=2 then : lblStartTime(2).Caption = rsRecordSet.Fields("Unit").Value & "" Regards Veena | |
Re: Hi, Can you post sample data of few lines over here..? | |
Re: Hi, Immediately after setting recordsource, you have to refresh.. try this : [code=vb] adodc1.recordsource = "Select name from emp where name='" & Text2.Text & "'" Adodc1.Refresh text1.text =adodc1.recordset.Fields(0) [/code] Also check, ConnectionString is set before running the above code.. Regards Veena | |
Re: Hi, Where are you writing this code ..? (Which event) and is there any other code before this line ..: If chancecount <= 8 Then ..? I guess, there must be a Loop there.. So which IF, you want to change to the loop? (there are 3 IF's) Regards Veena | |
Re: Hi, Which Database..? Access/MSSQL/Oracle..? | |
Re: Hi, I Guess, if it is an ADO recordset, you can give Just One Column Search, (not multiple). Like Debasis said, open another Recordset with "Where" Condition Regards Veena | |
Re: Hi, First Create a ".DLL" of Project2... Then in Project1 Include the DLL, and then you can Instantiate.. Regards Veena | |
Re: Hi, What I personally feel is, For databases like Access(<=2k), or .dbf, just use DAO. DAO objects/Methods are quite Flexible. For example, ADO's FIND, does not support Multiple Column search in Recordset. (No Matter whatever version), This Limitation Costs us to Open another Recordset Object. Whatever be the Technology, Important … | |
Re: Hi Abu, Well... Follow these Steps: Open a Data Project Add a Connection Object (Configure to your database) Add A Command Object (Say Command1) And Right-Click Goto properties and Select Option SQL Statement and Type : Select * From MyTable Where MyDate Between ? And ? Click on Apply, Parameter … | |
Re: Hi, Normalise your database, No need to save same data at 2 places, as you may later face syncronization problem, and Redundant data problem. What you need to do is Create a StudentMaster Table With ID, Name, Address.. etc.. and Save Stud_ID, in other Linked Tables, To get the name, … | |
Re: Hi, Instead of Executing, "Insert" Query, Open a Recordset and add.. REgards Veena | |
Re: Hi, U want to design a Report Based on the Result of a Query of Filter out Records for a Condition? For First Case, Use Stored Procedures For(Oracle/SQL SErver) Or QueryCommand(Access) Use "Select Records Expert" for Second Condition. It will Filter the Records and show, Eg for a period or … | |
Re: Hi, Try This Code: [code=vb] Dim FromDate As Date Dim ToDate As Date Dim TempDate As Date Combo1.clear FromDate = DateSerial(Val(cmbYear.Text), (CmbMonth.ListIndex+1), 1) ToDate = DateAdd("m", 1, FromDate) ToDate = ToDate - 1 TempDate = FromDate For TempDate = FromDate To ToDate Combo1.AddItem (Format(TempDate, "dd-mm-yyyy") & " " _ & … | |
Re: Hi, Check The Length and Prefix a 0 [code=vb] If Right(UCase(Text1.Text), 1) <> "R" then Text1.Text = Text1.Text & "R" End If If Len(Text1.Text) < 7 Then Text1.Text = String((7-Len(Text1.Text)),"0") & Text1.Text 'Pads with zeros to make 7 Chars End If [/code] Regards Veena | |
Re: Hi, Set ComboBox's Style = 2 -DropDown List This will allow user to only select from the available List Regards Veena | |
Re: Hi, Try This : Text3.Text = Format(Val(Text1.Text)+Val(Text2.Text), "0.00") Regards Veena | |
Re: Hi, I Guess, there is no in-built control like that in VB6, But you can Create one.. Place a Timer Control on the Form, and set its Interval =200 Also Place a Label Control.. Write this code: [code=vb] Private Sub Timer1_Timer() ' Static T As Integer Static LFlag As Boolean … | |
Re: Hi, You cant have Multiple columns like that.. What you can do is, use a Uniform Width Font and Pad the results with Spaces, and populate the listbox.. Set ListBox's Font = "Courier New" and Load List Like this : [code=vb] Dim strReq as String * 10 Dim strName as … | |
Re: Hi, [URL="http://www.vbforums.com/showthread.php?t=356751"]Check This Link[/URL] Regards Veena | |
Re: Hi, You cannot set the Start-Up position for the MDI Child forms in VB6.. This is from MSDN Help: The initial size and placement of MDI child forms are controlled by the Microsoft Windows operating environment unless you specifically set them in the Load event procedure. So You can write … | |
Re: Hi, Open Report In CR Designer, Goto menu : Insert >> Special Field >> Record Number Field and then Save the report REgards Veena | |
Re: Hi, Try This : [code=vb] Dim TNode as Node Set TNode = Trvw.Nodes("AG. -0300") 'Note Ag.-300 is the Key of the node MsgBox TNode.Children [/code] Regards Veena | |
Re: Hi, Try This : [code=vb] Dim i As Integer Dim TAmt As Currency TAmt = 0 For i = 1 To Grd.Rows-1 TAmt = TAmt + Val(Grd.TextMatrix(i, 8)) Next TAmt = TAmt +Val(txtBudget.Text) MsgBox "Total Amount Is : " & Format(TAmt, "0.00") [/code] Change names of your controls, and Column … | |
Re: Hi, Yes it should be [URL="file://\\ServerSharedFolderName\reservation97.mdb"]"\\ServerSharedFolderName\reservation97.mdb[/URL]" Note here, the Sahred Folder in Server Name Should Have Complete Read/Write Access.. Regards Veena |
The End.