vb5prgrmr 143 Posting Virtuoso

Okay, right click on the toolbox and select components. When the dialog comes up, scroll down to Microsoft Windows Common Controls-2 6.0(SP6)>select>OK (BTW: SP6b found at MS). Then when you hover over the controls, the control you are looking for will have a tooltip of DTPicker...


Good Luck

vb5prgrmr 143 Posting Virtuoso

Just so you know there is a calendar control in VB already but that did not stop me either... Now, as it seems you are just learning, the question comes on how much you do actually know? Do you know how to create controls at runtime by either loading controls in arrays or by creating objects? Do you know about the various date functions? Do you know how to tell which years is a leap year?

Now, I could go on and on with the questions but I don't want to overload you with them. Best bet, since creating this thing will cover many areas, is to start with some code that accomplishes part of your task and if you have any problems with that code come back, post your code and we will try and help you...

Good Luck

vb5prgrmr 143 Posting Virtuoso

gem, you can find all that information with your friends (yahoo, google, ask, answers, bing)... alls you need to do is a little research and read your text book on how to do it....

Good Luck

vb5prgrmr 143 Posting Virtuoso

You've asked a question that covers a broad area and without further clarification, we would only be taking shots in the dark. So please, describe your system in more detail as in is it a client server database program or is it a client server chat program ... etc...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Hey Walt, bd asked how not can I... :)

bd, see the ado tutorial or use your friends (yahoo, google, ask, answers, bing) to search for vb6 ado tutorial and once you have that under your belt, search for vb6 ado grid...

Good Luck

vb5prgrmr 143 Posting Virtuoso

As I showed you before in your original thread http://www.daniweb.com/forums/thread268844.html you need to have some code to set the variable and some code to retrieve the value and since vb is an event driven language, that code you write is more than likely to stem from an event, LIKE THE CLICK EVENT OF A COMMAND BUTTON! It will NOT just appear automatically! You have to do somecoding of some sorts!!! And as I pointed out, it was an example!!! You could use the form load event if you wish it does not matter but under some event the code must go!!!

vb5prgrmr 143 Posting Virtuoso

sidnei, I believe quick is wanting to convert 1,234.56 to One thousand two hundred thirty four and fifty six or ... four dollars and fifty six cents...

So quick, I suggest you use your friends (yahoo, google, ask, answers, bing) and search for vb6 convert number to words or if I remember correctly, search this forum for those keywords as I believe just a month or so ago someone posted the solution you are looking for...

Good Luck

vb5prgrmr 143 Posting Virtuoso

It's an example....

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

Yeah that is strange, Disk or Network Error and still the form loads....


Okay, got a couple of things for you to do...

First, start a new standard exe project and goto Tools>Options>Editor Tab and make sure there is a check next to Require Variable Declaration>OK

Second, close that out and start a new standard exe project. Add a form (Form2) and in form load of form1 or under a command button, put the same code... meaning load form2/form2.show.

Now, does that error appear again?
1. Yes? Vista or 7? Then right click on vb6.exe and select runas admin.
No? Well then, we have concluded that it is not the form so add the dataenvironment/report. Did that error appear again?
Yes GoTo 1 right above...

The only other thought I have about that error is that the hard disk might have a bad sector so copy the whole project to a new folder (I doubt this but it is a problem that can happen).

Beyond that, I can only guess it is something that you have done when you added something or saved something...?????

Good Luck

vb5prgrmr 143 Posting Virtuoso

Code in Form1...(Add Command Button (Command1))

Option Explicit

Public MyPublicInteger As Integer

Private Sub Form_Load()
Load Form2
Form2.Left = Me.Left + Me.Width
Form2.Top = Me.Top
Form2.Show
End Sub

Private Sub Command1_Click()
MyPublicInteger = 4
End Sub

Code in Form2...(Add Command Button (Command1))

Option Explicit

Private Sub Command1_Click()
MsgBox Form1.MyPublicInteger
Form1.Command1.Value = True
MsgBox Form1.MyPublicInteger
End Sub

Run and click on form2's command button and if you need to, step through it with F8...

Good Luck

vb5prgrmr 143 Posting Virtuoso

In a very bad explanation... The reason you need to use a bas module is because both the form and class modules are considered to be private and thus protected code and when compiled will resist information being injected into these areas of the executable, as that is what the callback is doing, injecting information into the address space of another process...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well what I get out of the OP's gobble de gook is something about bubble sorting arrays in ascending order and having to repeatedly go to the bathroom...

vb5prgrmr 143 Posting Virtuoso

As BrianWren is trying to point out, each file in vb6 has header information that is not displayed and it is this information that vb6 decodes to determine the actual type of file it is. VB6 does not just rely upon the file extension alone, it uses these headers, especailly for those files that represent a graphical interface like the frm file, and to see these headers, do as Brian suggests, open them in notepad.


Good Luck

vb5prgrmr 143 Posting Virtuoso

I may not be understanding something here but once you have that point, that center point that is fifty meters away calculated, then do you not need to draw your circle from there? As most circle drawing methods that I know of use the center point to "center" where the circle is... And then, what I don't understand is why do you need to calculate all 360 degree points of the compass? Perhaps you should go back and ask that person why you need to calculate those extra points???


Good Luck

vb5prgrmr 143 Posting Virtuoso

kinwang2009, it is you that is mistaken as neosonic stated in post #1...

>I want to save the whole picture into a bmp file (including the multiline textbox).

(I think you are confusing the print screen function, which takes a picture of the desktop or a particular window and allows you to save that image to file, with printing to a printer...)


Unfortunatlly neosonic, your options are limited but what you can do is use the printscreen method shown to you to capture the image of just the textbox. Then use that image to alter the original image by using bitblt api or the slower paintpicture method. Then, once that is done, you would use the savepicture method which will save the graphic as a bitmap...

Note: There are methods of saving the contents of a picture box as a jpeg but this will involve a lot more code and definitly delving into the API and if you use your friends (yahoo, google, ask, answers, bing) and search for vb6 save jpeg, you should get some sample code...

Good Luck

vb5prgrmr 143 Posting Virtuoso

You want hardcore, these guys have hardcore... http://www.thescarms.com/VBasic/timer.aspx

Good Luck

vb5prgrmr 143 Posting Virtuoso

Actually, reading a file opened for input and using the input function with either LOF or FileLen could raise this error. Instead of opening for input you would want to open as binary. As an example... (adjust if you installed vb somewhere else...

Dim FName As String, FNumb As Integer, FCont As String
FName = "C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Misc\SECUR02B.ico"
FNumb = FreeFile
Open FName For Input As #FNumb
FCont = Input(FileLen(FName), #FNumb)
Close #FNumb

Now as you will see when you run this code it will give you the error 62, input past end of file but if you adjust for input to for binary, there will be no problem...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Time to use your friends (yahoo, google, ask, answers, bing) and search for vb6 ReadProcessMemory or you could use the task manager to see how much your program takes up in memory...

Good Luck

vb5prgrmr 143 Posting Virtuoso

use the DateDiff function (see help for how to use) and test DTP.Value versus Date...

Good Luck

vb5prgrmr 143 Posting Virtuoso

q2, requests like this can get you banned from almost every forum site I know of as your request is illiciting illegal behavior. Meaning that it is still illegal to download "free" copies of VB6. Now I know as the rest of us do that you don't want to do anything illegal so you have a few choices. One is to go over to nextag.com and search for any of the following...

Visual Studio 6.0 Enterprise
Visual Basic 6.0 Enterprise

Visual Studio 6.0 Professional
Visual Basic 6.0 Professional

You can also try ebay and or your friends (yahoo, google, ask, answers, bing) but I would suggest you add the word buy or purchase to your queries...

And Finally, purchase the MSDN subscription from M$ and then from M$ you can download any of the versions I noted above.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Lets see your new code/project...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well, I can give you a hint on task 2...

Elect a team lead/integrator. The best programmer between you or the one who says/volunteers that they can integrate each of your codes into one program. From there, each of you treat your part of the program as a whole complete object and if there has to be an exchange of data between forms, say form1 and form2, then the two programmers who are working on those forms need to come to an agreement on how that data is going to be passed.


Good Luck

vb5prgrmr 143 Posting Virtuoso

This subject has been covered many times over the years and as such, as search with your friends (yahoo, google, ask, answers, bing) should provide you with some results...

Now, as for requesting a registration key upon installation you have many different choices on how to do this. There is the setup package that comes with VB, the PDW, which is customizable but it is outdated. Then there is the update for it, Windows Installer 1.1 (see pined thread on tips and tricks to find the link to download it from an archive site), which you can also customized with downloads from M$. Search M$ for Windows Installer SDK. Then there is Inno, wise, and a few more out there.

NOTE: If you decide to make alterations to the Setup1.exe project (found where VB is installed), I suggest that you make two copies of it. One for backup, and one for alterations.

Now, if you don't want to go with the setup route, you can go an easier way and that is alterating your project so when it runs the first time it prompts for the registration key...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well if you are using a dynamic array, you can always check the UBound for looping and then use redim preserve for reallocating/redimensioning your array to hold more information...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Did you turn UAC off???

Good Luck

vb5prgrmr 143 Posting Virtuoso

Since that one form has the only data control that you use, you would need to reference that form and use the right control name "db1"...

Good Luck

vb5prgrmr 143 Posting Virtuoso

How can it open after loading???

vb5prgrmr 143 Posting Virtuoso

Don't know about them/that but search for ezVidCap vb6...


Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, you have the Data control database name set in the properties window to "C:\My Documents\Actron\Customer Complain\CustomerServiceDB97.mdb" which of course errors on my machine as I don't have that path. You do realize that you can set the path in code if you wanted (db1.databasename = "C:\..." or App.Path & "\...mdb"), of which I did this in your frmview load event...

Private Sub Form_Load()

db1.DatabaseName = App.Path & "\CustomerServiceDB97.mdb"
End Sub

and because of this I was able to view the records...

As for option explict AKA Tools>Options>Editor tab>Require Variable Declaration... This forces you to declare every variable used and if you make a typo, it'll tell you when you go to run the program that the variable has not been declared...


Good Luck

vb5prgrmr 143 Posting Virtuoso

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

Good Luck

vb5prgrmr 143 Posting Virtuoso

Once again, as I am repeating both WaltP and kinwang2009,...

What method do you use to open the file(s) in question presently???

Native...

FreeFile Function
Open Statement
Input Function Or Line Input Function
Close Statement

Or via the API CreateFile, or FSO, or are you actually using the API ShellExecute or intrinsic Shell functions to spawn another process to open the file for you????

vb5prgrmr 143 Posting Virtuoso

hmmm... In references, move dao up so it is before anything to do with data access or ADO... Also, the use of option explcit will solve some other problems you may be having and in frmMain, you should at least be using the query unload event to test why the form is closing as when I ran your project and click on the x in upper right, prog was still running. You could use the query unload event to test why the form is closing and show the login form again or unload all forms as necessary...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well using integers will not allow for the showing of cents or decimal value portions of a dollar...

MsgBox Format(-1000.45, "$#,#.00;-$#,#.00")

Good Luck

vb5prgrmr 143 Posting Virtuoso

Using your friends (yahoo, google, ask, answers, bing) you would have found that this problem has been encountered before and there are several solutions out there that all pretty much begin with right clicking on the vb6 setup.exe and selecting run as admin...

Good Luck

vb5prgrmr 143 Posting Virtuoso

The simplest way is to run a service on the computer with the webcam, i.e. a webserver, expose the camera through it and then connect to it via the ip address or you could use your friends (yahoo, google, ask, answers, bing) and search for vb6 connect webcam, of which would have returned this result...

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

but that is in .net. However, further down my search you would have found this... http://www.shrinkwrapvb.com/

Good Luck

vb5prgrmr 143 Posting Virtuoso

Access *.mdb? Try compact/repair on exit...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Using the Printer object, you could use its currentx and currenty properties to line up your text before you enddoc it...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Type in mid and press F1 to bring up help or you could use your friends (yahoo, google, ask, answers, bing) and search the www for vb6 mid function...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Hmmm....

tblCustomer
iCustID 'auto number
vFName 'first name
vLName 'last name

tblCustBal
iBalID 'auto number
iCustID 'number-foreign key to tblCustomer's unique id (auto number)
'...

Or however you have your tables designed... Then in access, tools>relationships, drag iCusID from tblCustomers to iCustID in tblCustBal. When the dialog comes up, select referential integrity>OK.

Now, that is a defined relationship that you will have to enforce via the business rules of your code..., you can however just enforce this relationship in code without the database relation... Not recomended but there are cases where such things are needed...

Good Luck

vb5prgrmr 143 Posting Virtuoso

...Like "'%" & inputedvalue & "%'"

Good Luck

vb5prgrmr 143 Posting Virtuoso

It looks like it is possible but the error you reported is a problem with your query... It is saying that this part...

strSQL = "SELECT * FROM tablename

is the problem. It might be you have accidently misspelled the table name in some way or anothere. Go back and check to see that you have it spelled correctly... Also, sometimes M$ Access will report the incorrect error code through the drivers, so to double check, use debug.print on your query string and copy it from the debug window to the sql window of the create a query in access. Run it and see if there is a problem and what that problem is...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Ahhh.... I see... You need to use a for loop along with the mid function to retrieve each character from the string. Then you could use either a select case or an if elseif endif structure to test that character and build your output string...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Sounds like you want to add the ability for user to run a script at runtime... See microsoft script control under components and in help. Also, use your friends (yahoo, google, ask, answer, bing) and search for vb6 script control as I know there are a couple of examples out there...

Good Luck

vb5prgrmr 143 Posting Virtuoso

raj, you know by now not to raise the dead and instead copy the url into your thread if you need to reference it... I am reporting your post...

vb5prgrmr 143 Posting Virtuoso

Well Student02, I kind of got a kick out of reading your posts as my mind or experience has sometimes gone along the same path as you have shown your mind's travels... :)

Good Luck

vb5prgrmr 143 Posting Virtuoso

It is not that much different if I remember correctly, just replace rs with adodc1 and you should be able to use the same queries in its recordset arguement...

Good Luck

vb5prgrmr 143 Posting Virtuoso

strSQL = "SELECT SUM(Amount_Paid) AS THESUM FROM tablename"
'open
Result = Rs.Fields("THESUM").Value

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