vb5prgrmr 143 Posting Virtuoso

This should get you started...

http://visualbasic.about.com/od/standalonevb6/l/blnewieinstance.htm

However use the .Navigate instead of .Navigate2 method and to capture the user navigating to another site you will have to create a beforenavigate event. To see how to create such an event use a dummy project and add the webbrowser control (Microsoft Internet Controls).

Good Luck

vb5prgrmr 143 Posting Virtuoso

Without having to change any of your code you can still accomplish what you want. In the forms design view, highlight the button and then goto its properties. Find the "default" property and make it true.

This property tells the OS that this button is the default button to press when user hits enter key.

Good Luck

Vineeth K commented: Thanks for new Idea ........ +1
vb5prgrmr 143 Posting Virtuoso

I see where you check each grade for < 0 but I do not see a check for > 100...

(0+0+0+0+0+0+0+0+0+1000)/10=100

Also, I see where you initialize each new student grades to 100. Doing this before they do any work is a free A and as far as I know, there are no free A's but that is more of a stylistic point but could come into question under the following scenario...

Teacher recieves work from student for lessons 1-4 and 7-10 but not for 5 and 6.

Your present way: ?+?+?+?+100+100+?+?+?+? thus forceing the teacher to go in and edit grades 5 and 6 because the student did not do any work.


Beyond that, does everything else work ok?

Good Luck

vb5prgrmr 143 Posting Virtuoso

but once again they are all on different lines...

vb5prgrmr 143 Posting Virtuoso

I thought I answered this before but then again... could have been a connection hiccup

When comparing two text files for differences, there are many ways to accomplish this but since you have narrowed it down to a visual display, I would suggest that you use RTB's for the visual display.

Then, you need to define a little better on how you want to display these differences because once you come across the first difference, the rest of the file is different. Which means, if you want to only show the specific differences within the data itself, even if there are extra line breaks (vbNewLine), then your formula will need to be able to search for not only differences but commonalities also.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Hmmm....

1. your example pic shows both left aligned
2. multiple controls (op said one)
3. example also shows RTB's with style of 3D which would put an artifact in the center of the two text areas. Style would need to be flat and if OP wanted to have that 3D border then OP would also have to contain the two text/rtb's within a picturebox (as it has the same/simular 3D border.

PinoyDev commented: very helpful +1
vb5prgrmr 143 Posting Virtuoso

If you are using an object, i.e. ADO and a Do While Loop you could do something like...

Dim Cnt As Integer
adoRs.MoveLast
Prog1.Max = adoRs.RecordCount
adoRs.MoveFirst
Do While Not adoRs.EOF
  'populate grid...
  Cnt = Cnt + 1
  Prog1.Value = Cnt
  adoRs.MoveNext
Loop

Good Luck

vb5prgrmr 143 Posting Virtuoso

Not even with an RTB but you could fake it.

Easiest way would be to use a mono spaced font like courier new and add the required number of spaces between the two sets of numbers.

Good Luck

vb5prgrmr 143 Posting Virtuoso

something like that but I don't see where you pass in which studentid you want to total but I'm betting you have that someplace.

Also, it looks like (with the consol.writeline) that you may be programming in a different language than "Classic" Visual Basic 6.0 so in the future you may want to find the correct forum.

So, when building a program I do it step by step and your first step is to be able to add a student name and then be able to scroll through the added names.

Next step is to be able to select a student name and add a test score. This should probably have the ability to scroll through the test scores and to alter the test scores.

Then based upon those test scores, the ability to display an average for the selected student.


So how far have you actually progressed with this?

vb5prgrmr 143 Posting Virtuoso

In this forum it would be Visual Basic 6.0 code

vb5prgrmr 143 Posting Virtuoso

Looks/sounds like you are trying to make a stack class (hint there are your keywords) Use your friends (yahoo, google, ask, answer, bing)

Good Luck

vb5prgrmr 143 Posting Virtuoso

Not that I am going to go to the trouble of a class but...
'10 names..
Dim Student(1 to 10) As String
'with 10 grades each
Dim Grades(1 to 10, 1 to 10) As Integer
'For identifying student no in array
Dim StudentID As Integer
'for looping through grades and capturing total and result
Dim LoopCnt As Integer, Total As Integer, Result As Double

From the looks of it you have the basics of the user interface down so I will skip to the calculaton loop for a single student...

Total = 0
For LoopCnt = 1 To 10
  Total = Total + Grades(StudentID, LoopCnt)
Next LoopCnt
Result = Total \ 10

Good Luck

vb5prgrmr 143 Posting Virtuoso

Nope, not as far as I know. You could also use the webbrowser control and read the file that way but once again it is "downloaded".

Good Luck

vb5prgrmr 143 Posting Virtuoso

Quite simple with the URLDownloadToFile API...

1. Use API to download file with file name
2. Open with Open Statement, Line Input Function, FreeFile Function, Close Statement
3. Use API to download named file
4. Continue on with rest of program

Good Luck

vb5prgrmr 143 Posting Virtuoso

Wrong forum K, that is .NET code and this is the "classic" Visual Basic forum!

vb5prgrmr 143 Posting Virtuoso

You might want to ask this in a C or Java forum...

Good Luck

vb5prgrmr 143 Posting Virtuoso

So, from what I can understand, you want to pull values from form1 to form2. If this is correct then you can do this a couple of different ways.

One of the easiest is to add a standard module and declare a couple of public variables that you will use to hold the values you want.

Another way is to declare a couple of public variables in the general declaration section of form1...

Option Explicit

Public MyVar As String

and from form2 you would reference it thus...

MyForm2Var = Form1.MyVar

However, if you don't like to needlessly create extra variables AND the values you want to pass are contained within the textboxes then you could do something like this from form2...

MyForm2StringVar = Form1.Text1.Text

Good Luck

vb5prgrmr 143 Posting Virtuoso

Beyond the books and all the tutorials you can find all over the web, there must be some driving force behind your willingness to learn and that usually comes in the form of what you are interested in. So there is the conundrum... What is it that you want to learn about? Graphics, data access, ?,?,?

Once you have figured that out, see if someone has done it before by using your friends (yahoo, google, ask, answer, bing). There is so much code out there that you can learn from it is not funny. I have well over a terrabyte of examples I have not even had the chance to look at (but at least I do remember where I got them from). See the first pinned thread for just a small listing of sites that have code.

Good Luck

PS. ...becoming what their are right now. Ahh that would be "...becoming what they are right now." :-)

vb5prgrmr 143 Posting Virtuoso

Use your friends (google, yahoo, ask, answer, bing) with keywords vb6 tutorial

Good Luck

vb5prgrmr 143 Posting Virtuoso

yes access does as it is part of the ansi standard....


Between...And Operator
Determines whether the value of an expression falls within a specified range of values. You can use this operator within SQL statements .

Syntax
expr [Not] Between value1 And value2

The Between...And operator syntax has these parts:

Part Description
expr Expression identifying the field that contains the data you want to evaluate.
value1, value2 Expressions against which you want to evaluate expr.


Remarks
If the value of expr is between value1 and value2 (inclusive), the Between...And operator returns True; otherwise, it returns False. You can include the Not logical operator to evaluate the opposite condition (that is, whether expr lies outside the range defined by value1 and value2).

You might use Between...And to determine whether the value of a field falls within a specified numeric range. The following example determines whether an order was shipped to a location within a range of postal codes. If the postal code is between 98101 and 98199, the IIf function returns “Local”. Otherwise, it returns “Nonlocal”.

SELECT IIf(PostalCode Between 98101 And 98199, “Local”, “Nonlocal”)

FROM Publishers

If expr, value1, or value2 is Null , Between...And returns a Null value.

Because wildcard characters , such as *, are treated as literals, you cannot use them with the Between...And operator. For example, you cannot use 980* and 989* to find all postal codes that …

vb5prgrmr 143 Posting Virtuoso
Option Explicit

Private Sub Form_Load()
Dim I As Integer

For I = 1 To 10
  List1.AddItem CStr(Int(10 * Rnd) + 1)
Next I

End Sub

Private Sub Command1_Click()
Dim I As Integer, Tot As Integer
For I = 0 To List1.ListCount - 1
  Tot = Tot + Int(List1.List(I))
Next I
List1.AddItem "Total = " & Tot

End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Vineeth K,

You can't just move your program. You need to create an installable package. The PDW that comes with VB is a bit outdated but will work for some systems. For Vista it will need to be run as administrator or better yet download either inno or windows installer from MS.

Next up, where to put your data on vista...

See post #5 and the attachment.

http://www.vbforums.com/showthread.php?t=558385

you should be able to modify that code to find the special folders

dammysky,

From the properties window copy the connection string for the ADODC. Then in the forms load use the same property and paste the string there (ADODC1.ConnectionString = "?"). If useing Data1 then it would be Data1.Database = "?". That is the property you would need to change.


Good Luck to all

vb5prgrmr 143 Posting Virtuoso

A combination of the webbrowser control, DOM, and the URLDownloadToFile API will do this for you.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Use the application wizard that you can find under Add-ins

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

Look in the properties of the ADODC (Database or connectionstring I think?). Copy it, paste it, see the path? Now, remove that setting from the properties box and put it in form load as it is. Make sure it still works. Now you should be able to figure out how to change it.

Good Luck

vb5prgrmr 143 Posting Virtuoso

What is your destination OS? If vista or 7 then you need to do some adjustments to make your VB6 program compatable. See...

http://www.vbforums.com/showthread.php?p=2807202#post2807202

Then, you need to download the updated installer from MS for VB6 as the PDW will have problems installing on those OS's...

http://search.microsoft.com/results.aspx?form=MSHOME&mkt=en-US&setlang=en-US&q=download+windows+installer+1.1

Good Luck

vb5prgrmr 143 Posting Virtuoso

See...

http://www.connectionstrings.com

to find the DSN Less connection string for both. Then you will need to use ADO to connect to one or the other (I'm thinking MySQL), and use the minimal driver info for an insert into query.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Where is the name??? When you create an ODBC DSN you give it a name. I see where you supply which driver but not its name.

Then, since you are using ADO, you could if you wanted, use a DSN Less connection string... see http://www.connectionstring.com

Good Luck

vb5prgrmr 143 Posting Virtuoso

select into or insert into...


Good Luck

vb5prgrmr 143 Posting Virtuoso

Google, yahoo, bing, ask, answers, ... are your best friends as is http://www.planet-source-code.com as there are a few examples out there.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Google, yahoo, bing, ask, answers,... are your friends as is http://www.planet-source-code.com plenty of examples out there.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Use and insert into query (Just saw this somewhere on the web so this is from memory)

INSERT INTO TableName FROM (dBase IV; Database=PathToDBF)

(might be square brackets [])

Good Luck

vb5prgrmr 143 Posting Virtuoso

Not quite sure what you are after but the mouse down and mouse up events have a button argument that allow you to test for which mouse button was pressed. For milliseconds look at the GetTickCount API.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Looks like .NET code but in VB6 we would use App.Path...

Good Luck

vb5prgrmr 143 Posting Virtuoso

I don't see a reason why you are experiencing these symptoms... What OS? What SP?

vb5prgrmr 143 Posting Virtuoso

Yes, see this codebank submission by dilettante at vbforums...

http://www.vbforums.com/showthread.php?t=532752

or these by CVMichael...

http://www.vbforums.com/showthread.php?t=283785
http://www.vbforums.com/showthread.php?t=237843

Then I believe you should be able to find more examples with your friends (yahoo, google, bing, ask, answers, etc.)

Good Luck

vb5prgrmr 143 Posting Virtuoso

To get started on learning ADO to connect to SQL Server, first create an ODBC DSN (Administrative tools, ODBC Data sources). Next start a new project and use the Data Form Wizard with the options of code to create a form for you. Then, goto http://www.connectionstrings.com to replace the ODBC DSN with a DSN Less connection.

Now, with excel you can also use ADO to access its data or you can use automation. If you search with your friends yahoo/google/bing/ask/answers you should be able to find many different tutorials on both methods.

Good Luck

vb5prgrmr 143 Posting Virtuoso

No, you would have to open the one up that contains the sync macro and the easiest way would be to record a macro that does what you want.

Good Luck

vb5prgrmr 143 Posting Virtuoso

maskededit.text = format...


Good Luck

vb5prgrmr 143 Posting Virtuoso

So then you have it solved then...

vb5prgrmr 143 Posting Virtuoso

You have two options...

use the...
.Left
.Top
.Width
.Height

Properties or you could use the...

.Move

Method

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, I normally use SQL Server Authentication but presently surrounded by machines with no SQL Server so this is from memory...

Start SQL manager (MMC?) (on the server). Connect to the instance that you eventually want to connect to. Connect to the database and if you right click??? I think you should be able to add a user there. Give them read/write/modify/etc. access.

Now, while you are there start query analizer (sp?) and use the login you just created and hopefully you should have your database listed in the combobox at the top...

Now, from XP machine where you are having trouble. First try to create an ODBC DSN (Admin tools? ODBC Data Source) to see if you can connect. I'm betting that you don't acutally have the correct driver on your system for the DSN Less connection you are trying to create, which means you will have in instal a MDAC from MS.

Okay, so you can connect, now rebuild your connection string from the info provided a connectionstrings.com, but be sure that you have the correct template for sql auth...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well, I know the format function formats it like you want...

MsgBox Format("4321", "00-00000000")

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, loading a frame based upon a frame with controls placed on it will not instantiate those contols. You also have to load those controls and set their container property as I previously said/wrote/typed.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Frames have an index property also....


Good Luck

vb5prgrmr 143 Posting Virtuoso

Not really, I see no differenct between item 1 and 2. However, if split does not work for you and your example is an actual representation of your data, then you could use the Left Function, Mid Function, Trim Function, Right Function, and (etc. on string functions) to pull it apart manually.

Good Luck

vb5prgrmr 143 Posting Virtuoso

use the format function on the input of the four numbers to format it the way you want to display.

Good Luck

vb5prgrmr 143 Posting Virtuoso
Dim MyArray() As String
MyArray = Split(List1.List(1), " ") 'or if tab seperated vbTab instead of " "

Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes it is possible to make a generic subroutine to do what you want to, to reduce your code on the instantation but either way it may increase your code on the other end.

Use a module, create a public sub with arguements that accepts the form, the frame to copy, and the destinition tab to instantiate the new controls on.

The form arguement is to enumerate through the controls that are on the form and you would test the controls container property against the passed in frame. If true then you know you need to duplicate that control. Don't forget to set the new instantiated controls container.

The specific tab is for setting the container property of the frame to the specific tab.

Good Luck