vb5prgrmr 143 Posting Virtuoso

As you have found out, since the PB is a container control, you can have the PB anchored to any side of the MDIParent form but it cannot be free floating. However, you can make it look like it is free floating by using a MDI child with no caption and no toolbox with a borderstyle of none. Then you could size your PB to the size of the form...

Good Luck

PoisonedHeart commented: Tnank you for your help! +2
vb5prgrmr 143 Posting Virtuoso

Not English, Engrish!

vb5prgrmr 143 Posting Virtuoso

What you are talking about is a word I coined a few months back and that is Necroposting...

Necroposting has been discussed before and the current suggestion or last suggestion to prevent this is, if the last post is greater than 30 days old do not show edit field but instead show closed statment. Now, I would like to alter that close statement so it has a start a new thread button and link back to this thread so when it is pushed, the title is filled in for user who can change it, and there is a in reference to this thread filled in for user in the edit box. Also, if the last post is between 30 and 90 days old, only the OP can resurrect the dead...

Presently, report the necroposting and or highjacking if such is going on and request the new post be split from the old post and put into a thread of its own...


As for your sig, I hate bugs, you gotta love this one... :)

Nick Evan commented: It's not a bug, it's a feature :D +0
Lusiphur commented: Nice 'feature' :twisted: +0
vb5prgrmr 143 Posting Virtuoso

This question has been asked before in many a forum and if you use your friends (yahoo, google, ask, answers, bing) to search for vb6 ideas, or vb6 project ideas, you should find a few results with lots of answers. In fact, if you search this forum you will see/find a couple of threads where this question has been ask and answered before...

Good Luck

PoisonedHeart commented: Thank you very much!! +1
vb5prgrmr 143 Posting Virtuoso

I THE MIGHTY NECROPOSTER COMMAND THIS OLD DEAD THREAD TO RISE!!!! Rise I Say! Rise to the top of this forum and become relevant again! Rise! Rise! RISE!!! I COMMAND YOU TO RISE!!!! :) :) :)

(Hey, since I am the OP I have a right to raise this old dead thread!!!) :) :) :)

Okay, new design and we still only have two colors, red and green! Yucky!!! :) Hey, we need at least blue and black to be added to the selection of colors to be able to overwrite the incorrect syntax coloring when we use the code tags.

I think with those four colors and the ability of those colors to override the incorrect syntax coloring it will be a compromise between present and a hex/rgb solution. That, and add spoiler tags so text is the background color for those off beat forums and I think everyone could be happy... :) :) :)

vb5prgrmr 143 Posting Virtuoso

Just a thought or a suggestion for you Dani et. al. If the last post is older than X number of days old (say 30), remove the reply box and in its place, put a button/link that says something like "Would you like to start a new thread that references this one?", and of course they would be taken to the post new thread page for the forum and the first line in the edit box would be, In reference to "This Thread:Thread Title Name", which of course would actually be the BB code for the link back to the thread being referenced.

Bonus... Only the OP can resurrect the thread... (like I'm about to do... that is if I can find it...)


Just a thought...

EDIT: During my search I see that this has been brought up before... http://www.daniweb.com/forums/thread265375.html

vb5prgrmr 143 Posting Virtuoso

Speaking of searches... I don't know if this has been mentioned before or in this way, but, search forum, just the forum, not the site, and/or perhaps a selection of forums to search but exclude all the others... just a thought...

vb5prgrmr 143 Posting Virtuoso

Maybe as a sub forum of Java...

vb5prgrmr 143 Posting Virtuoso

and if one cannot fix the take me to the latest post in the thread, why must I wait for the entire page to load, hit end just so I can get to the next page link. Put it at the top also...

vb5prgrmr 143 Posting Virtuoso

Where are the post numbers so one can easily reference a previous post within the thread???

vb5prgrmr 143 Posting Virtuoso

As adatapost pointed out, you need to look up the following in help or online...

FreeFile Function
Open Statement
Line Input Function
Close Statement

Then, use your friends (yahoo, google, ask, answers, bing) and search for vb6 excel tutorial or vb6 automating excel...


Edit: Also while searching, vb6 common dialog tutorial


Good Luck

kvprajapati commented: Helpful! +9
vb5prgrmr 143 Posting Virtuoso

You are using VBA and NOT VB6.0. VBA is an interpreted language while VB6.0 can be compiled to native binaries (exe's, dll's, ocx's, etc.). So yeah, looking in Visual Basic 6.0 forums, your going to find a whole lot of functionality that VBA does not support... at least right off on a lot of it and it is very understandable why some people get confused between the two because they do share the same basic code base.

So, in the future you might want to look for VBA specific coding forums or Office forums for some things, but because the languages are so similar, usually you can get your answers from VB6.0 forums.

Now, to your specific problems...

A VBA form does not expose a hwnd as it is an interpreted and hosted form but you can add certain controls that do have a hwnd, but also because it does not expose a hwnd, it does not expose a windowstate and thus an icon in the appbar. The menu editor, is specific to to VB6.0 but that does not mean you cannot create your own menu with some tricks.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Not a problem,... For future reference if you want to print things in colums, by not using spc or tab, build your output string before sending it to the printer...

Dim S As String, I As Integer
Printer.FontName = "Courier New" 'makes it easier to use mono spaced font
S = "Test Col 1" 'so far left aligned
'now next column is to be 40 characters from left but the colum is to be right aligned and the column is 3 characters wide (so positions 41-43)
I = 41 - Len("Test Col 1")
S = S & Space(I)
I = 3 - Len("12")
S = S & Space(I) & "12"
'and so on
Printer.Print S

However, that code can also be done like this...

Printer.Print "Test Col 1"; 'so far left aligned (it is the ; character that says not to goto the next line)
'now next column is to be 40 characters from left but the colum is to be right aligned and the column is 3 characters wide (so positions 41-43)
I = 41 - Len("Test Col 1")
S = S & Space(I)
I = 3 - Len("12")
Printer.Print Space(I) & "12";
'and so on

and another way would be to use the currentx/y properties (as I think I mentioned before)

Glad you solved it...

BTW, set for autoredraw to true and remove the printer part of printer.print and you can see a preview of what your output is like but once again you …

vb5prgrmr 143 Posting Virtuoso

With VB you can accomplish a lot of what you want with the format function. Other functions like Space, Len, and Me.TextWidth("string") would also be of help. Now, when printing with the printer object you can do one of two things. You can use the currentx/y properties to alter where you place your next piece of text or you can format the entire line with other functions like spc and tab (see Print Method in vb's help).


Good Luck

vb5prgrmr 143 Posting Virtuoso

Think arrays, and think a single control for each letter... Then use your friends (yahoo, google, ask, answers, bing) and search for vb6 hangman to find some actual example programs...

Good Luck

Nick Evan commented: Sounds like solid advice to me :) +12
vb5prgrmr 143 Posting Virtuoso

Precautions in designtime to consume less memory... (you would watch the vb6.exe memory consumption in debug mode...)

Use control arrays as much as possible.
Don't over crowd forms with controls.
If you can, put as much code into modules and classes as you can as the forms graphical elements take up a lot of memory.
When using data access methods and you have a table with an extreme amount of records, don't use a select * unless you absolutly have to for your program.
When you can unload formname/set formname = nothing to totaly remove it from memory.
And this goes with the one above... Don't use public variables in the forms because if you need access to the information contained within that variable, you have to keep at least part of the form loaded. So put the public variable in a module and that way you will have access to it from everywhere when you need it.
Don't load an excessive amount of graphics into memory (icons, who cares, but pictures like bmp's, jpeg's, and the like, yeah you gotta watch those).
The same thing can be said about files you open up, meaning text files and such that you open with the Open Method.
When you can, use an image control instead of a picturebox control or a label instead of a textbox... i.e. use the lightest weight control you can for the purposes needed at hand...

Good …

vb5prgrmr 143 Posting Virtuoso

See this faq for more information... http://www.vbforums.com/showthread.php?t=555378

Good Luck

vb5prgrmr 143 Posting Virtuoso

To begin with, you cannot format an autonumber within the field itself, which does not mean you cannot format it for display, but it does mean you will need another field to store this formatted number and it will need to be a text field. It also means that you will also need another table to store that last student number used for current year...

tblLast
iYear 'current year
iNo 'this is the auto number

Now, this above table will only ever have one record...

So, your process will be...

With the student name information, check to see if student exists.
If student does not exist then
Select * from tblLast
'check to see if we are in same year or have we moved into the next
if Format(Rs.Fields("iYear").Value, "yy") <> Format(Year, "yy") then
UPDATE tblLast SET iYear = " & Year & ", iNo = 1"
StudentIDStringValue = Format(Year, "yy") & "-0001"
else
StudentIDStringValue = Format(Rs.Fields("iYear").Value, "yy") & "-" & Format(Rs.Fields("iNo").Value + 1, "0000")
UPDATE tblLast SET iNo = [tblLast].[iNo]+1"
End IF

And then from there you could/can insert your record into your student table...

Good Luck

vb5prgrmr 143 Posting Virtuoso

As kinwang2009 pointed out, the use of the msgbox function is called for here, but as you may be wanting to have a custom message box, you will need to show the form vbmodal and/or return a value from that form.

Load FrmMsgBox
FrmMsgBox.label1.caption=”Do you want to save the record?”
FrmMsgBox.Show vbModal, Me
If GblMsg = 1 Then Call SaveRecord

Then in FrmMsgBox you need to add Unload Me to each buttons click event AFTER you set your global variable...

Good Luck

vb5prgrmr 143 Posting Virtuoso

See third code segment in second post of this tutorial... http://www.vbforums.com/showthread.php?t=384076

Good Luck

betabasic commented: very nice :D +1
vb5prgrmr 143 Posting Virtuoso

Walt, search my handle and Open and you will see more often than not my suggest is to read in help about the following

FreeFile Function
Open Statement
Input Function or Line Input Function
Print Statement 'for writing out
Close Statement

But some days when I'm feeling charitable or when the OP has put forth the effort like this one has, you will see an answer like the above...


Have a nice day

WaltP commented: I can live with that :o) +9
vb5prgrmr 143 Posting Virtuoso

Close...

Dim MyString As String, MyStringArray() as String, ForLoopCounter As Integer
'...open rs etc..
Do While Not Rs.EOF
  MyString = MyString & ","
  Rs.MoveNext
Loop
MyStringArray = Split(MyString, ",")

For ForLoopCounter = 0 To UBound(MyStringArray)
  '....

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well since you are using an illegal copy of VB you can use the MSDN at MS for a lot of your look ups on builtin functions...

As for doing it without using screenshots...

Wow! Just found this... http://www.newfreeware.com/development/257/
when I was looking for this... http://support.microsoft.com/kb/193379


Good Luck

vb5prgrmr 143 Posting Virtuoso

Hmmm... Three child forms... Well, you are either going to need to capture a screenshot of each and assemble a bitmap from them and then print that out, or use a report of some kind. Either a data report or crystal reports should do the trick for you if you go that route. Now, if you have VB6.0 pro or enterprise, you should find a directory called crystal on your install disks. This is crystal reports 4.5 or 4.6. and is fairly easy to use...

Good Luck

vb5prgrmr 143 Posting Virtuoso

So spawn the upgrade exe from the dos batch file...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Technically sidnie, Access the application is a DBMS just as SQL server is while the *.mdb and *.mdf (access and sql server) are the data files in question and an ASP application could use the *.mdb but I would suggest that you upgrade your DBMS to a better one because...

60 x 60 x 24 = 86400 entries and if that is nothing but longs x 4 = 345600 / 1024 = 337.5 Kb * 7 = 2362.5 Kb which is not much but I doubt you are just storing a long value.

Good Luck

pankaj.garg commented: thanks...but more help needed :) +1
vb5prgrmr 143 Posting Virtuoso

You will have to enumerate through the nodes to find out which ones have been selected and if they have then retrieve the information you want from them...

Option Explicit

Private Sub Form_Load()
Dim N As Node
Set N = TV.Nodes.Add(, , "Root1", "Root1")
Set N = TV.Nodes.Add(, , "Root2", "Root2")
Set N = TV.Nodes.Add(, , "Root3", "Root3")
Set N = TV.Nodes.Add(, , "Root4", "Root4")

End Sub

Private Sub Command1_Click()
Dim N As Node, ForLoopCounter As Integer

For ForLoopCounter = 1 To TV.Nodes.Count
  If TV.Nodes(ForLoopCounter).Selected = True Then
    MsgBox TV.Nodes(ForLoopCounter).Key
  End If
Next ForLoopCounter

For Each N In TV.Nodes
  If N.Checked = True Then
    MsgBox N.Text
  End If
Next N
End Sub

Now, as you can see, if you are using check boxes (as I set mine up to have), the checked property is different than the selected propert and as you can see, I have shown you two different ways in which to enumerate through the items in a treeview control...

Good Luck

vb5prgrmr 143 Posting Virtuoso

ggeu,

You have gone over the same information that I have posted and the OP, pan, has replied to my post that you repeated, that they cannot place a control on the form at design time and that they must create the control at run time. Which means this is the code pan is looking for...

Dim C As PictureBox
Set C = Controls.Add("VB.PictureBox", "Picture1")
C.AutoRedraw = True
C.AutoSize = True
C.Picture = LoadPicture("C:\Program Files\Microsoft Visual Studio\Common\Graphics\Bitmaps\Assorted\balloon.bmp")

C.Visible = True

Good Luck

pankaj.garg commented: thanks +1
vb5prgrmr 143 Posting Virtuoso

You will have to add the setup files to your setup package.

Then you have a couple of options...

1) Customize the Setup1.exe project so that it installs the MySQL files with, if any, of the appropriate command line switches if user wants it on that particular machine. Meaning, install the service on one machine as the server and just the program on other machines. (I must warn you that if you go this route, you need to make at least two backup copies of this project that you can find where vb is installed on your computer)

2) Use Inno, Wise, or some other 3rd party software to do this for you.

3) Include it as a seperate setup package with instructions on how to setup the system, especially if you are wanting to make it easy on yourself and the end user so that they can pick the machine the service is installed on.

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

Oh okay! You want to search on vb drag and drop tutorials and on vb6 resizing controls at runtime...

http://search.yahoo.com/search?p=vb6+drag+and+drop&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701

http://www.tek-tips.com/viewthread.cfm?qid=501202

Good Luck

pankaj.garg commented: thanks..this was what i was looking for +1
vb5prgrmr 143 Posting Virtuoso

ansar.vb,

Welcome to the forums. Just so you know and so you are not labeled a necrophiliac, necromonger, or a necromancer. It is not polite to raise the dead. If you need to reference an old thread like this, please copy its url into your new thread posting.

As for your question, if you are using ADO see http://www.connectionstrings.com for some of your answers to a properly formated connection string.

Now, if you are using RDO the answer is pretty simple as you will need to place the database on a machine that has a public share. Then you will need to configure your ODBC DSN's to point to that database.

The same goes if you are using DAO ODBC Direct.

Now, if you are using DAO, you will need to either map to the share from each machine or use a UNC path from each machine that points to the share and db.

As for ADO, the above applies whether you are using an ODBC DSN or an ODBC DNS Less connection.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, if you want to see if a file or directory exists, you can use the Dir Function (see vb's help files for full description). So, what you would do, is something like...

Dim ForLoopCounter As Integer

For ForLoopCounter = 0 To Combo1.ListCount - 1
  If Dir(App.Path &  "\Ordinance\" & Combo.List(ForLoopCounter) & "\" & txtFind.Text & ".txt") <> vbNullString Then
    'Found
  Else
    'Not Found
  End If
Next ForLoopCounter

Good Luck

vb5prgrmr 143 Posting Virtuoso

Some simple calculations...
20 * 60 = 1200 * 60 = 72000 * 24 = 1728000 * 365 = 630720000 / 1024 = 615937.5Kb / 1000 = 615.9375Mb / 1000 = .6159375Gb
25 * 60 = 1500 * 60 = 90000 * 24 = 2160000 * 365 = 788400000 / 1034 = 769921.875Kb / 1000 = 769.921875Mb / 1000 = .769921875Gb

Which means that if you will be capturing a minimum of .615 to .769 Giga bytes of information. That is if each of your 20 to 25 fields are bytes and only bytes. This does not account for any unique fields like identity/autonumber fields which are a minum of four bytes for each record. Then there is your datetime stamp which is going to be eight bytes per record.

So what does all this mean? Well, you are going to have to figure out what each field is going to be and how much data that type takes up. Then once you have your record size, you can simply do the above calculations to figure out the minimum amount of disk space you need. Once you have that, you will then have a better idea of what kind of database you can use.

But that/this is not your only consideration when it comes to performance. Since you are going to be adding records every second, your machine will need a decent amount of ram because of the lag time between OS/server and hard drive …

pankaj.garg commented: thanks again for help :) +1
vb5prgrmr 143 Posting Virtuoso

Yes, you have code something like this...

Dim F As New Form1
F.Show

somewhere in your code. Find it, change it to Form1.Show. Should fix it.

Good Luck

vb5prgrmr 143 Posting Virtuoso

3 Okay, the MDAC is the Microsoft Data Access Components and yes you need it.
2 Those 3 are one in the same...
1 Yes, as previously stated you need those three files...

Tell users to right click on setup.exe and run as admin or download Windows Installer 1.1 from microsoft or check out the Inno setup for vb 6.0 as these are both free.

Good Luck

pankaj.garg commented: thanks for the inputs +1
vb5prgrmr 143 Posting Virtuoso

Add a module, and add...

Sub Main()

End Sub

Then add the code you need to inside of sub main but don't forget to put in your Form1.Show or your program will look like it does not even run. Next, GoTo Project>Properties and on the right there is a combo box right under the words "Startup Object:". Select Sub Main and hit OK.

Good Luck

pankaj.garg commented: thanks...this helped.. +1
vb5prgrmr 143 Posting Virtuoso

abdalla,

You are in the wrong forum! You need the .NET forum! And when you post your question over there, DON'T RAISE THE DEAD! Create your own thread!!!

Damn necrophiliac's :)

Good Luck

Nick Evan commented: agreed && moved +10
vb5prgrmr 143 Posting Virtuoso

GoTo the school or public library and watch how the transactions are made. Write down, step by step, how a typical transaction goes. Talk with the employees there and find out the steps they go through for each and every transaction. Then, figure out the five W's. Who, what, when, where, and why. Why is always money spent and saved in labor and equipment. Who is the current employees and how much more productive they can be and perhaps the reduction in labor by X% because of the automation. What has to be done to implement this new system (barcoding books and the initial data entry of current inventory). When is project timeline to completion of each phase of project and how much estimated time it will take to complete each phase.

Good Luck

vb5prgrmr 143 Posting Virtuoso
Private Sub Command1_Click()
Dim F As Form
Set F = New Form1
F.Show
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

In form1 create a public sub so when you hide form2 you can call it...

Form1.MyPublicSub
Me.Hide

then in the form1's mypublicsub you instruct whatever data access method you are using to refresh/requery itself and to redisplay the information.

Good Luck

pankaj.garg commented: thanks... +0
vb5prgrmr 143 Posting Virtuoso

two different ways are shown in the following...

Option Explicit

Private Sub Command1_Click()
OpenShowFile
End Sub

Private Sub OpenShowFile()

On Error GoTo OpenShowFileError

Dim FName As String, FNumb As Integer
Dim FileContents As String

CD.CancelError = True
CD.Filter = "Text Files *.txt|*.txt"
CD.FileName = vbNullString
CD.ShowOpen

If CD.FileName = vbNullString Then Exit Sub

FName = CD.FileName
FNumb = FreeFile

Open FName For Input As #FNumb
FileContents = Input(FileLen(FName), #FNumb)
Close #FNumb

Text1.Text = FileContents

Exit Sub
OpenShowFileError:

If Err.Number = 32755 Then Exit Sub 'user pressed cancel

End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Don't think so but look at Project>References. You should have these four at the top and in this order...

Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation

Okay, so you are wanting to create an access database and not just open one (as what your code is saying...)

Okay, see post #12 in this thread for an example... http://www.codeguru.com/forum/showthread.php?t=476345

or since you are using DAO start a new project and add the 2.5/3.51 compatability library and then type in...

Dim DB As DAO.Database
Set DB = DBEngine.CreateDatabase

and with the cursor somewhere in or at the end of createdatabase press F1 to bring up help.

Good Luck

pankaj.garg commented: Thanks...this helped +0
vb5prgrmr 143 Posting Virtuoso

Okay, in your first post you set the lock type with the second code snippet but I don't see it in the first code snippet, which means if you have not explicitly set it, it defaults back to its default settings, which might be your problem.

Now, in your second post, you have formatted the insert statement incorrectly. Presently it looks more like an update statement but that is neither here nor there or the answer to your problem. So, a properly formatted insert statement looks like this...

strSQL = "INSERT INTO tablename(Numberfieldname1, Stringfieldname2) VALUES(" & VariableContainingNumberValueForFieldName1 & ",'" & VariableContainingStringValueForFieldName2 & "')"

Good Luck

Edit: to see correctly toggle to plain text

Israelsimba commented: great help indeed..thanx +1
vb5prgrmr 143 Posting Virtuoso

If you are talking about design time... then,... Drag mouse over all the controls you want to make visible = false. OR, you could put these controls in a frame, picture box, or other container control.

If at runtime..., then,... Same advice. Put the controls in a picture box and set its visiblity = false.

But then there is also this way...

Dim C As Control
For Each C In Me.Controls
  C.Visible = False
Next C

Good Luck

vb5prgrmr 143 Posting Virtuoso

You know what!!! If you really want someone to do this for you, then go over to rentacoder.com or odesk.com and hire someone to do it for you, else learn how to do it yourself by at least opening up the design environment and giving it a try...

jonc commented: Damn right, you tell him :P +2
vb5prgrmr 143 Posting Virtuoso

>u need think before u act

You need to know how to spell, and use correct grammer!

By the way. What were you thinking posting your question four times? Did you not think before you took action or did you just (removed by me because anything I say from here is just too mean)...

To answer your question on how to calculate 30%...

Result = Value * .3

Good Luck

jonc commented: I'm impressed by your restraint... I would have just spoken (typed) my mind :P +2
vb5prgrmr 143 Posting Virtuoso

Celt.Max,
the code you are using is for the VBA Listbox control found in Excel, access, etc. and while it is usable from VB6, it is not redistributable...

IvanKenny,
There are two ways in which to accomplish what you want...
1.) Use a listview control.
2.) Do a bit of subclassing on the listbox. See... http://www.thescarms.com/vbasic/listbox.aspx

Good Luck

ivankenny commented: get it solve my problem thx for the tip i used method 2 +0
vb5prgrmr 143 Posting Virtuoso

As for tutorials for either vb6 or any of the flavors of vb.net, you can use your friends (yahoo, google, ask, answers, bing) to find them. So you keywords would be vb6 read write consol.

Then in this thread, is just a small sample of sites I have collected up to that point that have code, tips, tricks, and tutorials...

http://www.daniweb.com/forums/thread214396.html

Good Luck

vb5prgrmr 143 Posting Virtuoso

Once again this is not a SMS site, which means you can expand all those abreviations into full words so we don't have to decode your short hand.

So you will also need to use SendMessage.

Good Luck