652 Posted Topics
Re: Hi, use KILL: [code=vb] If Dir("C:\MyText.txt") <> "" Then Kill "C:\MyText.txt" End If [/code] Regards Veena | |
Re: Hi, Try This : Code is easy for ListBox.. If you want To Poulate a Combo Only, Then Place a ListBox on the Form and Set it's property Visible = False [code=vb] Dim str1 As String RS.MoveFirst List1.Clear Combo1.Clear Do While Not RS.EOF str1 = RS("MyField") & "" List1.Text = … | |
Re: Hi, Once the [B]Grid is Loaded, [/B] Loop thru the column and Highlight if matching, Say, you are Date Column is 2, Check this Code: [code=vb] Dim i As Integer For i = 1 To Grd.Rows-1 If ISDate(Grd.TextMatrix(i,2)) Then If CDate(Grd.TextMatrix(i,2)) = Date Then Grd.Col = 2 Grd.Row = i … | |
Re: Hi, Using ADO, Create Database at Runtime.. Check this thread: [url]http://www.daniweb.com/forums/thread118188.html[/url] Regards Veena | |
Re: Hi, Set TABINDEX property for all the controls on your form starting from 0. When you hit TAB, automatically, control with next tab index, gets the focus.. Regards Veena | |
Re: Hi, In Access Value for High / True is [B][COLOR="Red"] -1[/COLOR][/B] so change this to : [code=vb] If cg_p_chk.Value = vbChecked Then cg_p_chk = -1 Else cg_p_chk = 0 End If [/code] So, While Getting Records back, Check for 0 [code=vb] If RS("MyCheckField") = 0 Then MyCheckBox.Value = vbUnChecked Else … | |
Re: Hi, Use [B]DateDiff[/B] function: dim t as integer t = DateDiff("d",cdate("19-10-1983"),cdate("30-09-2008")) You will get difference in Days, Replace d with yyyy for years m for month.. OR divide t by 12 to get years.. Regards Veena | |
Re: Hi, Just an Alternative Suggestion.. Why Not Use a MSFlexGridControl.. Add a Grid Control and rename it as "GRD" And in FormLoad, Write This Code: [code=vb] Dim i As Integer Me.Grd.Rows = 16 Me.Grd.Cols = 2 For i = 1 To 15 Me.Grd.Row = i Me.Grd.Col = 0 Me.Grd.Text = … | |
Re: Hi, Yes, there is a Limitation of Procedure Size, in VB6.. Looking at your code, appears, there is a Lot of Repeatation, say for example, this part : [code=vb] ElseIf txt7 > 0 Then lblItem6 = "W7~ John Doe" lblItemprice6 = "10.50" lblItemquantity6 = txt7 lblTotal6 = TotW7Price [/code] Is … | |
Re: Hi, In Form Load of Form2, write this code: Me.Text1.Text = Form1.Text1.Text (Here you have to show Form2, While Form1, is still Loaded) OR In Lost Focus of Form1's Text1, Form2.Text1.Text = Me.Text1.Text OR Keep a Public Variable in .bas module, populate variable in Form1's Text_lostfocus event, and Access that … | |
Re: Hi, You need to Remove the DISTINCTROW. Any way, you are grouping on Product_id, you dont need a Distinct.. Try this Query for PartDetail: [code=vb] Select Item_Code, ProductName, Max(ID) As MaxID, Sum(Qty) As MaxQty, Max(Unit) As ProUnit From Production Group By Item_Code, ProductName [/code] Regards Veena | |
Re: Hi, Remove the Single Quotes around Combo selection.. [code=vb] dim strSQL As String strSQL = "SELECT tblMain.ID, tblMain.Type, tblMain.Site, " _ & " tblMain.Room, tblMain.Area, * FROM tblMain WHERE " _ & " (((tblMain.Type) Like "*" & Forms!frmMain!Search2 & "*")) Or " _ & " (((tblMain.Site) Like "*" & Forms!frmMain!Search2 … | |
Re: Hi, You can write using any of the LOOP Structures, You already know the Algorithm.. so what is the problem..? Regards Veena | |
Re: Hi, Place a CommandButton "Populate" in the Frame, Initially, Make Grid2.Rows = 1. Select a Row, in First Grid, and Click On "Populate", write this code for commandClick. [code=vb] Dim i As Integer If Grid1.Row > 0 Then Grid2.Rows=Grid2.Rows+1 With Grid2 .TextMatrix(.Rows-1, 0) = Grid1.TextMatrix(.Row,0) .TextMatrix(.Rows-1, 1) = Grid1.TextMatrix(.Row,1) .TextMatrix(.Rows-1, … | |
Re: Hi, Try This Code: [code=vb] With ppSlide1.Shapes(3) .TextFrame.TextRange.Text = "Wing PRR :Total Weight: " .TextFrame.TextRange.Characters(Start:=1, Length:=9).Font.Color.RGB = RGB(255, 0, 0) .TextFrame.TextRange.Characters(Start:=10, Length:=12).Font.Color.RGB = RGB(0, 0, 255) .TextFrame.TextRange.Font.Bold = True .TextFrame.TextRange.Font.Color = vbWhite .TextFrame.TextRange.Font.Size = 26 .TextFrame.TextRange.Font.Name = "Arial" End With [/code] Change RGB Accordingly.. Regards Veena | |
Re: Hi, There is another on-going thread for datareport, I have posted a Solution in Page1 Check this : [url]http://www.daniweb.com/forums/thread155025.html[/url] Regards Veena | |
Re: Hi, In Access, you need to store [B]-1 [/B]value for Checked, and [B]0[/B] for UnChecked Regards Veena | |
Re: Hi, use [B]SLEEP[/B] API Declare this at the top of the Form's Code window (After Option Explicit) [code=vb] Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 'To Pause/Sleep for 10 seconds, write this code: Sleep(10000) [/code] Regards Veena | |
Re: Hi, Can you post, what code you have written for "Auto-Complete"...? Regards Veena | |
Re: Hi, You need to Split the Text into 2 Parts, and then Sort it.. Numeric Part should be formatted with Appropriate Zeros in Between.. Data need to be like this:... Data001 Data002 Data003 Data010 Data012 Data100 If you know how many distinct TextParts you have, Then Loop thru the ListBox, … | |
Re: Hi, Open your Project, and goto menu : File>> Make Project1.exe Select the path for the exe, thats all.. Regards Veena | |
Re: Hi, Try This Code : [code=vb] Dim MyStr As String Dim TotRTF As String Dim MyText As String ' MyText = "MYTEXTBOX" MyStr = "\par \trowd\trgaph108\trleft36\cellx1636\pard\intbl " MyStr = MyStr & MyText & "\cell\row\pard\par" With RTB .SelText = Chr(&H80) TotRTF = .TextRTF TotRTF = Replace(.TextRTF, "'80", MyStr) .TextRTF = TotRTF … | |
Re: Hi, Try This : [code=vb] Dim j As Integer Dim NewStr As String j = InStr(status_array(i), Format(Now(), "mm-dd-yyyy")) If j <> 0 Then NewStr = Mid(status_array(i), j) End If [/code] Regards Veena | |
Re: Hi, Try This : 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 Tab Is … | |
Re: Hi, You have 2 Options.. Create Small BMP files with all the Font Requires, and Load the Pictures on the Command Button.. Use RichTextBox, instead of Label and TextBox.. Regards Veena | |
Re: Hi, Change your code to : [code=vb] If KeyAscii <> 8 Then if keyascii >= 48 and keyascii <= 75 then exit sub else keyascii = 0 end if End If [/code] Regards Veena | |
Re: Hi, Can you post your code here..? Regards Veena | |
Re: Hi, Try This Query: Select TMonths, Date(), DateAdd('m',TMonths,Date()) From MyTable Replace TMonths with your Numeric value/FieldName Regards Veena | |
Re: Hi, Try This : [code=vb] msf1.ColWidth(0) = 400 msf1.ColWidth(1) = 1000 msf1.ColWidth(2) = 1200 msf1.ColWidth(3) = 1200 msf1.ColWidth(4) = 1500 [/code] With a little bit of judgement, you can do it.. Regards Veena | |
Re: Hi, VB.net have different File Objects.. Check this [URL="http://www.startvbdotnet.com/files/default.aspx"]Link Here[/URL] Regards Veena | |
Re: Hi, Which DLL you want to register...? Regards Veena | |
Re: Hi, If the field you are trying to SEEK is a String, then you have to wrap the search string with single quotes.. Also, SEEK works if the Recordset is open in TABLE mode, and INDEX has been defined.. Data1.Recordset.Seek "=", "'" & SearchStr$ & "'" Regards Veena | |
Re: Hi, An Easier way out is Control arrays.. In a New Form, Place a CheckBox Control on the from from the tool box, copy and Paste, VB will ask if you want to create control array, say yes, add 12 Times, all of them will have a same name, but … | |
Re: Hi, Not Clear.. What does Same Variable mean..? Do you want to get Selected Item of the ComboBox in Some Variable..? MyVar = Combo1.Text Regards Veena | |
Re: Hi, Try to Create Parameters like this : [code=vb] Set mobjPrm = mobjCmd.CreateParameter("@prmOne", adInteger, adParamInput, 2) mobjCmd.Parameters.Append mobjPar [/code] Regards Veena | |
Re: Hi, This is normally due to difference in Data-types.. Post your Select statement here.. Regards Veena | |
Re: Hi, Group Option Buttons and Place them on some Container like Frames, So for each set of Option buttons on the frame, One option can be true.. for your problem, you need 10 frames with 2 option buttons each.. Instead of Frame, you can use PictureBox as well.. Regards Veena | |
Re: Hi, Set this property for the form : ControlBox = False Regards Veena | |
Re: Hi, Place the Database in The Server in a Shared Folder, Shareing should be given with full read/write access.. Either MAP the Folder In all the systems OR Refer to UNC Path like this : \\MyServerName\MyShareFolder\MyDB.mdb Regards Veena | |
Re: Hi, Its always Better to Keep a Static Boolean Variable in such cases... Try this : [code=vb] Private Sub Command1_Click() Static TFlag As Boolean If TFlag Then Picture1.Picture = LoadPicture("D:\hehe\Sunset.jpg") Else Picture1.Picture = LoadPicture("D:\hehe\Winter.jpg") End If TFlag = Not TFlag End Sub [/code] Static Variables are Variables declared within the … | |
Re: Hi locsin, I guess, you must have set Form's Border = Fixed Dialog, make it Border = Fixed Single With msgbox, you form will not disappear.. Regards Veena | |
Re: Hi, Populate the ComboBox using This SQL Query: Select Distinct Reasons From MyTable And allow the User to Select one of them.. If a User wants to enter new Reason, In Keypress Event , Trap the Escape Key, and allow him to enter a New Reaon, Anyway, whenever, you save … | |
Re: Hi, Try ListView Control Regards Veena | |
Re: Hi, Its not vbTab, Column seperator here is Chr(9) Regards Veena | |
Re: Hi, Try this : Report.Printout False Without vieiwng the report.. Regards Veena | |
Re: Hi, How are the Forms Named..? You can code, if it is Named Sequential.. Say Form1, Form2, Form3.. Regards Veena | |
Re: Hi, Whatever code you have pointed, I guess, there should not be any space between "Else" and "If".. Check this : [code=vb] if RandomOrg = 1 Then Org.src = Org1Pic(Luck) Elseif RandomOrg = 2 Then Org.src = Org2Pic(Luck) Elseif RandomOrg = 3 Then Org.src = Org3Pic(Luck) End if [/code] Regards … | |
Re: Hi Shruti, rstkw has already answered you: Write this Code: Kill "C:\MyFolder\*.tmp" Change MyFolder, to whatever folder you want.. Anyway, whenever, you Kill files, you need to be carefull.. Regards Veena | |
Re: Hi, U can [URL="http://put.hk/article/news.microsoft.com/microsoft.public.dotnet.framework.adonet/138381/System-Transactions-Diagnostics-DiagnosticTrace-throws-an-exception-of-initialization.html"]Try This [/URL] REgards Veena | |
Re: Hi, if u dont want the use 2 input boxes, use one box and tell the user to enter Id and pwd seperated by a / and in ur code, u seperate both of them check this : [code] dim myarr dim mystr mystr=inputbox("Enter Uid/pwd") if instr(mystr,"/")>0 then myarr =split(mystr,"/") … |
The End.