124 Posted Topics
Re: DateDiff("d", "01/01/2008", "01/01/2010") Reference - [url]http://msdn.microsoft.com/en-us/library/aa262712(VS.60).aspx[/url] | |
Re: Try: ("select * from parlordb where custname=" & searchname) It appears you are using DAO as opposed to ODBC. If so, why not use: myrs1.FindFirst txtsearchname.Text | |
Re: If the printer provides a serial port interface, it may be easier to use that. If you must use the USB interface, this may help. [url]http://www.intel.com/intelpress/usb/examples/VBOverview.htm[/url] | |
Re: Do you mean a line that goes around the edge of the form, like a border? If so, you can Shape control, and redraw the Shape's dimensions in the Form_Resize event. As an example, create a Shape on the form with a Top and Left of 60. Then add Shape1.Height … | |
Re: That's because by the time Text2.Text = Text1.Text executes, Text1.Text has already been changed. Try: Dim Txt as String Txt = Text1.Text Text1.Text = Text2.Text Text2.Text = Txt | |
Re: Use a Label in front of each text box and in the Caption for the Label, use an & in front of the letter to define the shortcut key - &m in your example. Make sure the Label's TabIndex is one less than the TabIndex for its associated TexBox. That … | |
Re: Rich Text Boxes have two properties for text - .Text and .TextRTF. Are you using the right one? | |
Re: I put all my global declarations, constants and defined types in a module. | |
Re: Why not use a public boolean value as a toggle? SelectedAll = NOT SelectedAll Item.Checked = SelectedAll Then the function can select and deselect all depending on the last state. | |
Re: You don't have to lock the text box, just set KeyAscii to 0. Also, you need to handle the backspace key to allow users to fix errors: Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, 8 'Let these key codes pass through Case Else 'All others … | |
Re: The maximum number of controls on a form depends on the type of control and the available system resources. There is a strict limit of 254 control names per form. However, you can use control arrays or user controls to go beyond 254 controls. Check this: [url]http://support.microsoft.com/kb/229756[/url] | |
Re: Probably the easiest way to do what you want is to use a Browser control on your form and open the PDF file in the browser - Browser1.Navigate PDFFile$ - works like a charm and you're not tied to a particular version of Acrobat Reader. | |
Re: Just a guess... could it be the field is numeric, where your selection criteria (lblLECNUM ) is text (Caption property)? | |
Re: You can also try LockWindowUpdate to prevent the ListView from updating while the records are loaded. Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long Call LockWindowUpdate (ListView1.hwnd) 'load the records Call LockWindowUpdate (0&) | |
Re: There is no caption in the label to retrieve. | |
Re: [url]http://www.thescarms.com/vbasic/StopProcess.aspx[/url] | |
Re: I'm not sure why you're using a timer, but you can format time in 12 or 24 hour formats with the Format function - Format(Time$, "hh:mm:ss") or Format(Time$, "hh:mm:ss AMPM") | |
Re: Use a for/next loop to load the images from disk. If the number of images loaded is not evenly divisible by 2, you have a problem, since you can't match up an odd number of images. Use 2 image control arrays. Inside the loop, as each image file is read, … | |
Re: You could use the Split funtion, but that wouldn't work well if your string contains more than one space, for example "white bread 0.67" If the price is always the last part of the string, why not create a function that starts at the end and finds the last space? | |
Re: Why can't you just put centering code in the Form_Load event of the mdi child form? You know what window will be the parent, and it wouldn't matter is the parent is maximized or normal. | |
Re: Try the .Children property | |
Re: You have to use a richtextbox, but that only supports a subset of rtf, so you won't get full support of the rtf codes from Word. I have successfully brought in tables, even with borders, but the richtextbox won't maintain the integrity like Word does. Worse yet, in my experience, … | |
Re: You could use the multiple-document interface (MDI) in which the forms are a "child" of the "parent" main form, but MDI program can be a pain. Why can't you just use the main form's properties to decide where the other forms should appear? For example, in the Form_Load event of … | |
Re: Guess I'm not quite sure what you want to do, but if you want to sun the Windows Installer you can Shell the installer with the MSI file as a parameter. For example: Ret = Shell("MSIEXEC /I " & Combo1.Text, vbNormalFocus) Assuming Combo1.Text contains the name of the .MSI file. … | |
Re: Error '3077' Syntex error (missing operator) in expression Try Data1.recordset.FindFirst ("nhisto = " & answer) | |
Re: To some degree you can manipulate the msgbox, but if you haven't noticed, new message boxes in Vista and subsequently, Windows 7, have a nice look you can't get in classic VB without making your own - such as the high resolution icons. By making your own message box, you … | |
Re: One I particularly like... [url]http://www.innovasys.com/download/eval.aspx?productname=freeware%20activex%20controls[/url] | |
Re: Use a autonumber field as a key. Then randomly generate a number between 1 and the total number of questions to retrieve the questions based on the key. | |
Re: Here's a good example as a primer. [url]http://www.hungryhacker.com/articles/code/vb6_xml.html[/url] | |
| |
Re: One way is to separate the hours from the minutes and add them up = 42 hours, 172 minutes. Divide the minutes by 60 using INT divinsion - 172\60 = 2 or INT(172/60) = 2, so you have to add 2 hours to the 42 = 44 hours. To get … | |
Re: If you're using the RichTextBox, this may help. [url]http://www.vbforums.com/showthread.php?t=275310[/url] | |
Re: The Str function returns a leading space for the sign of number. Could that be messing you up? Sinec the leading space is there, you could use "R01" & str$(99) | |
Re: Why are you using extra quotes? ScriptPathandFile = "S:\DsnTools\Drawing Search Tool\UNIT ARRAY\" & ScriptFileName should do just fine | |
Re: May I suggest a slight coding change for efficiency and readability? Instead of : Private Sub File1_Click() If Combo1.ListIndex = 0 Then File1.Pattern = ("*.wav") ElseIf Combo1.ListIndex = 1 Then File1.Pattern = ("*.mid") ElseIf Combo1.ListIndex = 2 Then File1.Pattern = ("*.avi;*.mpg") Else File1.Pattern = ("*.*") End If Use: Private Sub … | |
Re: You need to use the SysInfo Control. It has properties for ACStatuse, BatteryFullTime, BatteryLifePercent, BatteryLifeTime, and BatteryStatus. It will also tell you when the power status changes, among many other things. | |
Re: Try resetting the Interval property. | |
Anyone experience problems with a disappearing control focus rectangle when using an XP style manifest? Some check boxes and option boxes no longer show the focus rectangle when the control gets focus using the kayboard and the tab key. Some do, some don't. Rather strange. I've tried putting them in … | |
Re: If I remember correctly, an earlier version of Visual Basic used to save files in binary format as the default (which loaded faster), with the option of saving them in text format. You'll have to load them in an older version and resave them in text format | |
Re: You misspelled bordercolor line1.bodercolor = vbRed line1.bodercolor = vbBlack line1.bordercolor = vbRed line1.bordercolor = vbBlack | |
Re: Been my experience that USB won't use an AutoRun.Inf file like a CD will. | |
Re: First of all, you declared MTime as Byte when you're using it as an integer. Secondly, why not just use the Timer event instead of MTime? Private Sub Form_Load() MMControl1.Command = "Open" MMControl1.Command = "Play" End Sub Private Sub Timer1_Timer() MMControl1.Command = "Stop" MMControl1.Command = "Close" MMControl1.Command = "Open" MMControl1.Command … | |
Re: You have Exit For outside every For-Next loop in cmdSubmit_click. Exit For is used to conditionally end the For-Next loop early... such as "If condition = true then Exit For." | |
Re: See if this helps: [url]http://support.microsoft.com/default.aspx/kb/178070[/url] | |
Does anyone know how to get the Rich Text Box to save margin information in a file? The RTB seems to ignore all margins. | |
Re: namefile = App.Path & "\Accounts\" & Text1.Text & ".txt" if Dir$(namefile) <> "" then msgbox ="Username already exists" else Open namefile For Output As #1 ... ... end if To avoid any potential conflicts in file numbers, you should use the FreeFile function: fileNumber = FreeFile() Open namefile For Output … | |
Re: Random numbers, where High is the upper limit and low is the lower limit of the range desired: Randomize Timer Rand = Int((High - Low + 1) * Rnd) + Low | |
Re: Unofrtunately, I believe so. I suppose you could dynamically add menu items in a common subroutine. Each form would have to handle the click events, although here too, you could call a common subroutine to do the actual work. It might be more trouble then its work, tracking which form … | |
Re: If I remember an old Charles Petzold article correctly, that specific progress bar was made with a gradient, and the motion was created by manipulating the color palette. | |
Re: That link should provide you with the best advice, but why not use the Visual Studio Installer? |
The End.