4,911 Posted Topics

Member Avatar for Alex_2011

[QUOTE]I wrote a code that stores three names[QUOTE} Your code actually stores 4 names. [QUOTE] - Make the user select a number (from 1-3) by using a (combobox) - If the user select the proper number then a message will appear that the name is there. [/QUOTE] How do you …

Member Avatar for Alex_2011
0
331
Member Avatar for sharathg.satya

If pressed, I would say number 4. Counters are incremented by fixed amounts. The increment in number 4 varies depending on the current value of counter. Technically, number 4 could be a counter if (for example) in a loop, the number of things you are counting doubles each time. Then …

Member Avatar for sharathg.satya
0
90
Member Avatar for Gobble45

I would create an array of denominations ordered from largest to smallest. Then I would create a while loop that runs while the balance (cash - cost) is greater than zero. An inner loop would select denominations from largest to smallest and determine how many multiples of each could be …

Member Avatar for Reverend Jim
0
150
Member Avatar for vivekanandaan

I don't know if COALESCE is available under Access (but it is under SQL). It takes a variable number of arguments and returns the first value that is non NULL. If you call it like COALESCE(MAX(Column),0) it may give you what you want (again, assuming it is supported under Access).

Member Avatar for Reverend Jim
0
724
Member Avatar for Reverend Jim

Could somebody please put a sticky post like [URL="http://www.daniweb.com/software-development/python/threads/366794"]this[/URL] at the top of the VB.NET forum? It's gotten to the point where people are now posting blocks of uncommented code and no actual question. It might help if the first thing at the top of the page was [B][COLOR="Red"]"Read This …

Member Avatar for WaltP
0
168
Member Avatar for adhani85

As a rule it is considered prudent to provide more than just a block of uncommented code and no actual explanation or question. What is the code supposed to do? How does this differ from what the code actually does? Are you getting any errors? What does your input look …

Member Avatar for thines01
-2
171
Member Avatar for jbutardo

I'm not sure what you mean by validate the file size. You can get the file size by [code] My.Computer.FileSystem.GetFileInfo(filename).Length [/code] Typically you would validate it by uploading it then comparing the size of the uploaded file to the size of the local file but you say you want to …

Member Avatar for jbutardo
0
568
Member Avatar for bilal_fazlani

You could use an Access database or an Excel spreadsheet. There are connection strings available for both of these. Even CSV files as I recall.

Member Avatar for bilal_fazlani
0
181
Member Avatar for Ghoztrider

The process I would use is as follows: [code] create an Excel application object create a workbook select the first worksheet set row index to first row for each selected csv file set column index to first column for each line in this file for each field in this line …

Member Avatar for Ghoztrider
0
2K
Member Avatar for bhavan kamble

First thing I would check is whether the query string on line 51 actually contains the query to delete the record you want. For example, if b doesn't have the value you expect then the query won't delete what you want. As for why the record is not being deleted …

Member Avatar for Reverend Jim
0
1K
Member Avatar for skran

You could build the query like [code] Dim query As String = "select * from Incidents" If txtDMA.Text <> "" Or txtStreet.Text <> "" Then query &= " where " If txtDMA.Text <> "" Then query &= "DMA = '" & txtDMA.Text & "'" End If If txtStreet.Text <> "" …

Member Avatar for skran
0
271
Member Avatar for Johnbonono

Some of this code is mine and some is not. It is an example of how to build a GUI for a console application. In this case, the application is md5sums.exe, which takes a file or folder name as an argument then calculates a checksum for the file, or all …

Member Avatar for Johnbonono
0
444
Member Avatar for jbutardo

Not sure how to answer that other than to ask what specific things you expect to be able to do, then address those things one by one. If the data is in a regular format (like a table where all rows are the same) then there should be no problems …

Member Avatar for jbutardo
0
1K
Member Avatar for sylvester3

I set up a test exactly as you specified and my text file contains A B C D E F Can you possibly post a screenshot of your app running?

Member Avatar for sylvester3
0
400
Member Avatar for ashishgh

I came across this piece of code once while trying to solve a similar problem. See if this helps. [code] Private Sub releaseObject(ByVal obj As Object) Try System.Runtime.InteropServices.Marshal.ReleaseComObject(obj) obj = Nothing Catch ex As Exception obj = Nothing Finally GC.Collect() End Try End Sub [/code] According to the person who …

Member Avatar for codeorder
0
280
Member Avatar for Bheeman89

What error message do you get when you try to connect? It is possible you don't have the correct access rights or that you misspelled the server name. Try changing the server name from "VNET-PC\SQLEXPRESS" to ".\SQLEXPRESS". Do you have SQL Server Management Studio installed? Can you verify that you …

Member Avatar for Reverend Jim
0
651
Member Avatar for Shodow

Let's try to narrow this down. I'm guessing that you have a database that you want to be able to search. The user is presented with a listview containing predefined search strings. The user (possibly) selects an item in the listview. This causes the database to be searched for the …

Member Avatar for Reverend Jim
-1
290
Member Avatar for NetJunkie

You can get the list of files with [code] Dim filelist() As String = System.IO.Directory.GetFiles("c:\windows\system32") [/code] Use a class variable to keep track of which file name to display next. The timer tick handler can advance the index (and wrap to zero if you want to repeat).

Member Avatar for Reverend Jim
0
199
Member Avatar for mrbungle

I find it useful to type these lines into a non auto-formatting window (Notepad, for example) then copy and paste into VB once it looks right. I suggest adding a line to display the connection string before you connect so you can verify that the string you see is the …

Member Avatar for M.Waqas Aslam
0
201
Member Avatar for dksmall

This will do it quick and dirty [code] Public Class Form1 Private groups(3) As GroupBox Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load Me.SuspendLayout() 'create 4 groups For g = 0 To 3 groups(g) = New GroupBox With groups(g) .Text = "Group " & g .Size = New …

Member Avatar for dksmall
0
242
Member Avatar for daydie

You haven't declared X to be of any particular type. TextBox5.Text is a string and you are adding one to it so I presume that makes X an integer (assuming it is declared at the class level). In your Do Until statement you are comparing X (possibly an integer) to …

Member Avatar for codeorder
0
205
Member Avatar for jbutardo

Let me get this right. You have a dataset in an Excel spreadsheet that may or may not have the field names in the first row. Why not just open it with Hdr=No and examine the first record (row) in your code? If there is a row header then you …

Member Avatar for jbutardo
0
942
Member Avatar for Ziggy713

Use [code] Query = "INSERT INTO PROD_DB_Complete_Board _ (ID, [Board Size], Laminate, [Stock Level]) _ Values('" & TextBox4.Text & "','" _ & "'" & TextBox2.Text & "','" _ & "'" & TextBox3.Text & "','" _ & "'" & TextBox1.Text & "')" [/code] It's easier to see the problem when the …

Member Avatar for Reverend Jim
0
182
Member Avatar for markdean.expres

I would imagine Process.Kill or Process.Close and if that fails you can always shell out to kill.exe or (if you download the free SysInternals suite) pskill.exe.

Member Avatar for markdean.expres
0
161
Member Avatar for dashawk

You can try [code] select name from Table2 where name not in (select * from Table1) [/code]

Member Avatar for Reverend Jim
0
264
Member Avatar for Ziggy713

Change it to [code] Query = "update Prod_DB_Laminate_Raw set [Stock Level] = '" & TextBox1.Text & "' where Laminate = '" & ComboBox1.Text & "'" [/code] Wnen you run into a problem like this it is best to display the actual query string as submitted to SQL. In most cases …

Member Avatar for Ziggy713
0
311
Member Avatar for neh555
Re: WPF

WPF is Microsoft's attempt to create a modeling environment that is consistent across platforms, whether your desktop or your browser. Until WPF, developers had to use one set of controls for each. The intention is to have once common set of controls (with consistent behaviour) for both desktop and web …

Member Avatar for Reverend Jim
0
164
Member Avatar for Sevyt

Are you searching an archive, a file hierarchy or a database? You seem to be referencing all three. And I am not sure what you mean by a cabinet? What, exactly, is the format of the stuff (for lack of a more precise term) that you want to search?

Member Avatar for Reverend Jim
0
236
Member Avatar for roottybrian

Value added note - you may want to check out this entry at [URL="http://ask-leo.com/cutepdf_writer_create_pdfs_from_any_application_that_can_print_.html"]Ask Leo[/URL]. He prefers Cute PDF Writer because he claims PDF Creator now installs unwanted software.

Member Avatar for Reverend Jim
0
371
Member Avatar for newbie26

The first thing that comes to mind is to check if anything in your code is setting the button state to visible. If you find any code that does this then set a breakpoint at that line and rerun.

Member Avatar for newbie26
0
176
Member Avatar for jasleen_kaur
Member Avatar for a1a4a

I think something like that is more suited to vbScript than VB. The following script takes 2 arguments, infile and outfile. Infile contains the unfiltered dictionary (one word per line). Outfile is the file to contain the filtered words (will be created if it does not exist). Here is the …

Member Avatar for Reverend Jim
0
245
Member Avatar for kenth21v
Member Avatar for kenth21v
0
3K
Member Avatar for aishapot

I'm assuming you are keeping the data in some sort of database (text, XML, Excel, Access, SQL, etc). In that case you wil have to create a table to keep track of the additions. Keep more info rather than less. For example, you asked how to keep track of the …

Member Avatar for aishapot
0
335
Member Avatar for zerofreak

[code] If TextBox1.Text.Contains("$1$") and TextBox1.Text.Contains("abcdefg") and Len(TextBox1.Text) = 32 then MsgBox("hit") End If [/code]

Member Avatar for zerofreak
0
175
Member Avatar for Mike Bishop

Are thr rows contiguous? For example, If I scan down a particular column, can I assume that the first blank cell I encounter indicates the end of the rows? If so I can provide some simple code to do what you want. I'll look it up and post it here.

Member Avatar for Phasma
0
2K
Member Avatar for benedict3578

Same question that has been asked a hundred times before - what have you got so far? I presume this is for an assignment as I cannot think of any other reason to write this. We don't do your homework for you. Show us what effort you have gone to …

Member Avatar for Reverend Jim
0
154
Member Avatar for aishapot

You can select the current maximum studentID for a given year by select MAX(StudentID) from Table1 where StudentID between 201100001 and 201199999 Once you have that you can split it into yearpart and idpart by yearpart = result \ 100000 idpart = result mod 100000 next studentID is 100000*yearpart + …

Member Avatar for Reverend Jim
0
199
Member Avatar for VB 2012

I need more details. By size (of the listbox) I presume you mean the number of entries in the listbox. What do you mean by "adding a process to the listbox"? And why are you comparing the listbox size to a size in task manager? I also don't know what …

Member Avatar for Reverend Jim
0
214
Member Avatar for azzdog_dev

You can't add code at runtime because VB code has to be compiled. However, it is still very useful to be able to add controls at runtime. For example, I wrote a version of Scattergories last summer. The number of players can vary from game to game so it is …

Member Avatar for VB 2012
0
266
Member Avatar for fvere

Read books. Write code. You learn to draw by drawing. You learn guitar by playing. Programming is the same. Wrox Press has several good books on VB programming. Also, Sybex. Check their websites. Books that claim that you can "Learn Visual Basic in 24 Hours" or even a week are …

Member Avatar for VB 2012
0
129
Member Avatar for Alex_2011

[code] Public Class Form1 Private Sub btnAdd_Click(sender As System.Object, e As System.EventArgs) Handles btnAdd.Click ComboBox1.Items.Add(Now) End Sub End Class [/code] Each time you click "Add", the current date/time will be added to the combobox. Just replace the argument with the text you want to add.

Member Avatar for Reverend Jim
0
110
Member Avatar for jbutardo

If you just want a simple text file then you only require simple text output (make sure you open the log file in append mode). I have a suggestion that should be obvious but wasn't to some of our in-house developers. Make sure every line that you write to the …

Member Avatar for jbutardo
0
19K
Member Avatar for PF2G

I'm not sure what your intention is in Sub Admin_Reg_Load but the logic is [code] if the connection is closed then open it else close it end if [/code] I can't imagine why you would need a Sub to toggle the state of the connection. Usually you would have code …

Member Avatar for adam_k
0
124
Member Avatar for prathapsv3

You can also install (free) CutePDF Writer. This is a (pseudo) printer driver. When you print to it (select it as a printer) it creates a PDF file. You can download it at [url]http://www.cutepdf.com/products/cutepdf/writer.asp[/url]

Member Avatar for Reverend Jim
0
359
Member Avatar for splitter66

I haven't tried this myself but could you use KeyPreview on the form to detect and ignore all Alt key press events?

Member Avatar for splitter66
0
199
Member Avatar for jbutardo

dim myarray(20) as parts This will create an array where each item can contain a reference to a part, however, the objects themselves do not exist until they are instantiated (with New). In order to actually create an array of part objects you have to do [code] for i as …

Member Avatar for Reverend Jim
0
170
Member Avatar for sheepboi

You are going to need a counter to keep track of the number of correct answers. This will be a class level variable which will go after the "Public Class Form1" line (your actual class name may differ. The line will look like Private numCorrect As Integer You can set …

Member Avatar for archelle
0
147
Member Avatar for markdean.expres

The first step is to set the form property KeyPreview to True. Once you have done that you can add a form level handler to process keys. A sample one (from one of my projects) is [code] Private Sub frmMain_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress 'This …

Member Avatar for Reverend Jim
0
93
Member Avatar for jbutardo

The easiest way would be to split it into three strings as mystring.Split("\") then validate each field separately. A more complicated way would be to use a regular expression.

Member Avatar for Reverend Jim
0
2K

The End.