vb5prgrmr 143 Posting Virtuoso

For the first part you need to look up an alter table statement for the second part...

tblStaffDuty
iSDID 'unique ID auto number
iStaffID 'foreign key to staff name table
iDutyID 'foreign key to descriptions of duties table
dDate 'date of duty

Good Luck

vb5prgrmr 143 Posting Virtuoso

There is no format unless you want to enforce one...

Conversion function or formulas can be looked up with your frinds (yahoo/google), after all it is just simple math. If you have a colledge dictionary, you might be able to find the formulas in one of the appendixes.

As for currency, you will need to find a web site that has the values based on a specific country. Then if you want to included the local formatting, as not all countries use the $ or the comma as a seperator you will have just a little bit more work to do but if you lucky, most of the information will be on the currency exchange rate page you find.

However, if you are wanting to use local settings from the computer you may have a whole lot more work to do.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Where are you getting the error? On the open line? Put full path to file as arguement ("C:\SomeDir\SomeFile.xls")

Do you know how to debug? Press F8 to walk through and post error number and description.

Example error handler...

Private Sub Form_Load()

On Error GoTo Form_LoadError

Exit Sub
Form_LoadError:

MsgBox Me.Name & " Form_Load " & Err.Number & ":" & Err.Description

End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Clear a table, add the captions, run the report against the table.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well then go with the LBound/UBound to make sure you don't run out of bounds...

For ForLoopCounter = LBound(MyArray) To UBound(MyArray)
  '...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, so for now... you don't mind starting the program before you leave, right?

One step at a time...

First, do you know how to read the file in by using VB? If not please look these up in help

Open Statement
FreeFile Function
Input Function
Line Input Function
Close Statement

Then, do you know about string parsing? If not please read up on these in help.

Left Function
Right Function
Mid Function
Trim Function
Replace Function
Split Function
Join Function

Okay, so now you know one way to read in and parse a csv file. Now for the excel part. Read this tutorial...

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

Need help with above, please post back in a new thread with the url of this thread referenced with the code that you are having problems with.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Not quite sure what you are trying to accomplish but...

MsgBox Join(MyArray, vbNewLine)

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

Even more curious???


Well at least you have something working now.


Good Luck

vb5prgrmr 143 Posting Virtuoso

You are probably actually pulling from your cache, use DeleteURLCacheEntry prior to making your download call....

http://vbnet.mvps.org/index.html?code/internet/deleteurlcache.htm

Good Luck

vb5prgrmr 143 Posting Virtuoso

Ahhh... I see, you have two possible filenames...Glad you got it solved.

vb5prgrmr 143 Posting Virtuoso

Some say it was blasphemous for ms to call their new OO programming languages VB and C but as things go they did. Here is some background that may help you...

http://windowsdevcenter.com/pub/a/oreilly/windows/ron/why_vba.html

http://www.adaptiveintelligence.net/Developers/Articles/YesVirginia.aspx

So be forewarned, the "Classic" VB and variants thereof (VBA, VBS) are no where near what you will find in the .NET environment and also be forewarned that someday soon, sooner than you would like, VBA and VBS will also no longer work or be a part of Office applications....

vb5prgrmr 143 Posting Virtuoso

So then you service is able to read from disk but for some reason was failing on the specific file??? Well, that is interesting! Glad you got it figured out.

vb5prgrmr 143 Posting Virtuoso

Several ways...
Several Questions...

Do you want your program to run as a service?
Do you know how to open a file and read it in?
Do you know how to automate excel?
Do you know how to use excel like a database with ADO?
Do you know how to use the Timer control?
If not a service, do you want to have your program launched as a task?
Where or with what part of the code you are working with do you have problems?


I could probably come up with a few more but these should get you started.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, through windows explorer, on the machine and under the account that the program runs, can you delete the file from there?

I'm wondering if it may be an accesibility rights issue.

Just for a quick test...

If Dir(PathFileName) <> "" then
  MsgBox "Found"
Else
  MsgBox PathFileName
End If

Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes, use the least common denominator when you package up your program, which means, that if you want your program to run on 98, 2k, XP, Vista, 7 then you need to compile it and package it on a 98 computer.

Or, lets say you program is only targeted for 2k and above and the machine you are on is 2k pro SP2 (where you developed and compiled). So that equates to the minimum OS your program is good for.

So, to make your program work on Win 2k you need to compile it on a 2k box.


That's the easy way. You might be able to get it to work by installing the vb runtimes on the 2k box and/or by creating a seperate installable where you remove all references for your installable when you package it up.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Check the format property of the field or you could just change the field to long and store it as a number in the format of yyyymmdd since you are only storing the date portion. This causes you a little more problems as you have to format it going in and parse it coming out but quering against it is much faster than a date field. One other though is try passing it as a string ( '" & a & "'" ) (I think it used to work been so long...)


Good Luck

vb5prgrmr 143 Posting Virtuoso
If Dir(PathFileName) <> "" then Kill PathFileName

Good Luck

vb5prgrmr 143 Posting Virtuoso

Maybe, it depends upon where you have put this file that you are trying to read. Once again, use the registry for your service.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Since you are only reading a single line, store the license key in the registry. As for debugging purposes, you should also add the value of the parameter passed in to this function to you error logging call. That way you will know if for some reason your passing in bad data.

Good Luck

vb5prgrmr 143 Posting Virtuoso

For SMS google and yahoo are your friends as there are plenty of examples out there and I'd bet you could find some at pscode.com. As for the database stuff, you could use the Data Form Wizard with the code option to get you started in learning ADO.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well to begin with, I would change you varient variable to a string. Then I would check to see if that string equaled vbNullString and if it didn't, then add the value retrieved from the database. Otherwise, why add an empty string to a combo box.

Good Luck

vb5prgrmr 143 Posting Virtuoso

What are the API's? What part of the registry does he manipulate?

vb5prgrmr 143 Posting Virtuoso

And your question is...???

vb5prgrmr 143 Posting Virtuoso

Use the data form wizard with the option of code (search for it in this forum and you will find my instructions on how to find it if you don't know where it is). Then see http://www.connectionstrings.com

Good Luck

vb5prgrmr 143 Posting Virtuoso

So that message box appears after your code tries to send the email right? For now on your design computer use spy to spy on that dialog box. Then code it up with FindWindow and SendMessage to click on the button you want.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well if your friend is doing it in delphi, then ask them what they are doing. Which API's and where. What settings and so forth. Then create it yourself.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, this has been discussed several times in many forums so you should be able to use your friends, google, yahoo, or any other search engine of your choice to more than enough examples and suggestions.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Did you create an install package with the PDW, Inno, or the new installer from MS? Sounds like you did not and so your program is missing dependencies.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Search the web for vb6 unicode controls.

Good Luck

vb5prgrmr 143 Posting Virtuoso

You could possibly be passing a negative value if your process takes longer than a second (Delay 1000 - Duration). Second, "End" is an execution command so perhaps you should change the declaration MyEnd or something else.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well there are many more sites out their with much easier to read fonts. Using a proportional on code that programmers are used to seeing in a mono space font is just silly. If you have any pull at the site, perhaps you should tell them to fix up the site.

As for sites that have code, tips, tricks...

http://msdn.microsoft.com/en-us/vbrun/default.aspx
http://www.vbexplorer.com/VBExplorer/winners.asp
http://allapi.mentalis.org/
http://social.msdn.microsoft.com/Search/en-US/?Refinement=22&Query=list+of+api+functions
http://search.microsoft.com/Results.aspx?qsc0=0&q=list+of+api+vb+6&mkt=en-US&FORM=QBME1&l=1
http://www.programmersheaven.com/tags/Visual+Basic/Files/
http://www.visualbasicsource.net/index.html
http://www.vb6.co.uk/
http://www.vb6.us/
http://search.brothersoft.com/vb-6
http://vbnet.mvps.org/index.html?code/network/index.html
http://www.vbaccelerator.com/home/index.asp
http://www.projectsjugaad.com/FORMS_AND_CONTROLS2.html
http://www.merrioncomputing.com/Programming/index.htm
http://btmtz.mvps.org/
http://www.codeguru.com
http://vbprojecta.brinkster.net/
http://www.a1vbcode.com/
http://www.programmersheaven.com/tags/Visual+Basic/Files/
http://www.vbcode.com/Asp/code.asp?SortBy=WeekDate
http://www.vbcode.com/Asp/code.asp?SortBy=Accessed&NumberToView=10
http://www.winsite.com/win95/programr/vbasic/
http://www.developerfusion.com/tag/vb6/
http://www.motobit.com/tips/listpg_0.htm
http://www.gdmag.com/resources/code.htm
http://www.gameai.com/
http://ai.eecs.umich.edu/people/laird/gamesresearch.html
http://www.aaai.org/home.html
http://en.wikiversity.org/wiki/Game_programming
http://www.truevision3d.com
http://ps2dev.org/ps2/Tutorials
http://msdn.microsoft.com/en-us/xna/default.aspx
http://nwvault.ign.com/fms/TopRated.php?content=nwn2tutorials
http://www.yoyogames.com/make
http://visualbasic.freetutes.com/
http://www.mvps.org/st-software/api_usage.htm
http://www.projectsjugaad.com/NETWORK_INTERNET3.html
http://www.binaryworld.net/Main/
http://www.jaredshelp.com/article65.html
http://www.freewebs.com/pradeepkrao/games.htm
http://www.mztools.com/resources_vs60_addins.aspx
http://www.planet-source-code.com/vb/contest/AllTimeHallOfFame.asp?lngWId=1
http://rookscape.com/vbgaming/
http://gpwiki.org/
http://www.programmingtutorials.com/
http://www.vbcity.com/page.asp?f=tutorials&p=index
http://vbnet.mvps.org/index.html?code/subclass/
http://directx4vb.vbgamer.com/DirectX4VB/CodeDownloads.asp
http://www.xbeat.net/vbspeed/
http://www.garybeene.com/code/lang_vb.htm
http://kandkconsulting.tripod.com/VB/VBCode.htm##AddIN
http://conradsharry.blogspot.com/2007/05/ocx-dll-library.html
http://www.lebans.com/
http://www.gamesforwindows.com/en-US/AboutGFW/Pages/DirectX10.aspx
http://vb.mvps.org/samples/apixref.asp
ftp://ftp.microsoft.com/developr/drg/Multimedia/Jumpstart/VfW11e
http://www.tech-archive.net/
http://visualbasic.about.com/
http://www.opensourcescripts.com/dir/Visual_Basic/
http://www.codeguru.com/vb/
http://www.devdos.com/vb/Visual_Basic.shtml
http://www.vbcodesource.com/
http://www.dmoz.org/Computers/Programming/Languages/Visual_Basic/Source_Code/

anlmember437 commented: Nice.. +0
coud_ren_26 commented: Thank you for the vb6 resources links you've posted. +0
vb5prgrmr 143 Posting Virtuoso

I have some programs that I design for full screen 640x480 and disable the max button on. That way now matter what the resolution is the form looks the same even if it takes up less real estate on the desktop.

Granted, some programs look better if all of the controls are resized based upon the resolution. So with that in mind...

see...

http://www.vbforums.com/showthread.php?t=376702&highlight=resize+controls

http://www.vbforums.com/showthread.php?t=138280&highlight=resize+controls


Good Luck

vb5prgrmr 143 Posting Virtuoso

Most users will have a problem with you changing their screen resolution but what you can do is set the maximized button to false in properties of the form. That way your form will constantly look the same even if it does not fill the entire screen.

Note: you should check the screen resolution prior to showing the form so you can make sure it will look correctly.


Good Luck

vb5prgrmr 143 Posting Virtuoso

I take it the *.MDB is on a share as the back end to an existing system. Can the system itself be modified? Should be simple enough for programmer to add table and a quick loged in loged out switch in table. Then table could be queried. Just a thought...

BTW [ / code]


Good Luck

vb5prgrmr 143 Posting Virtuoso

Well from the sounds of it if you really want the user to view and/or to be able to modify the receiptID then you are going to need another field. Your autonumber field should only be used for keeping the uniqueness of the record. If you still want to display this field then lock the user from being able to modify it, else you will recieve errors if the user does try to insert their own number into your autonumber field.


Good Luck

vb5prgrmr 143 Posting Virtuoso

You will need a variable to keep track of how many friends have been entered.

Dim MyFriendCount As Integer, LoopCounter As Integer

Then you will need to initialize your friend counter

MyFriendCount = -1

Then you will need to test to see if you haved entered any friends yet...

Dim FoundFriend As Boolean
If MyFriendCount = -1 Then 'no friend have been entered

But if they have then you need to test if you have reached the limit...

ElseIf MyFriendCount > 10 Then 'too many friends or you need to redimension array so notify user...

Then of course if you have not exceeded the friend count...

Else 'need to check to see if you have already entered friend
  For LoopCounter = 0 To MyFriendCount
    If UCase(Text1.Text) = UCase(Friends(LoopCount)) Then
      FoundFriend = True
    Else
      FoundFriend = False
    End If
  Next LoopCount
  
  If FoundFriend = True Then
    'notify user
  Else
    MyFriendCount = MyFriendCount + 1
    Friends(MyFriendCount) = Text1.Text
  End If
End If

Good Luck

vb5prgrmr 143 Posting Virtuoso

Does user perform an action to say they want to create a new record and when they perform this action you clear all fields except this new order number in preparation for user to enter data? Then...

Text1.Text = Trim(Rs.Fields("IDField").Value + 1)

(Note: In multi user environment this can become such a pain that it is not worth this kind of code.)

Or does this new number appear somewhere after the new record is added? Then...

strSQL = "UPDATE MyTable SET MyField = [MyTable].[MyField]+1"
Cn.Execute strSQL

(Note: Prefered way.)

Good Luck

vb5prgrmr 143 Posting Virtuoso

Seperate Q, but try value (or is this .NET?)

However, a command buttons value is only true when it is depressed (or you are inside the command buttons event).

Good Luck

vb5prgrmr 143 Posting Virtuoso
SELECT AccountInfo.incategory, Sum(AccountInfo.InAmount) AS TotalAmount
FROM AccountInfo
WHERE (((AccountInfo.Date)=#1/1/2009# OR (AccountInfo.Date)=#12/31/2009#))
GROUP BY AccountInfo.incategory;

Good Luck

vb5prgrmr 143 Posting Virtuoso

See the replies at ....


http://www.vbforums.com/showthread.php?p=3590854


Good Luck

vb5prgrmr 143 Posting Virtuoso

The correct declaration of this from the vb API viewer is...

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long

So from what I can tell the declaration that they are using is correct (its just without the alias), however, if you are trying to paste this code into a form, then you need to turn these declarations from public to private.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Check in the help files for the specs of the database. I'll bet you have gone over some sort of limit and i'm almost sure it is the 64k limit imposed on modules.


Good Luck

vb5prgrmr 143 Posting Virtuoso

Because once again you are trying to add strings together (+), you are supposed to concatinate them (&)

"SELECT * FROM tblMembership WHERE UserID = " & roleUserID

Good Luck

vb5prgrmr 143 Posting Virtuoso

So, you want the string to start off with a comma? Well then....

MyString = "," & MyString

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, first future reference. In VB's IDE, goto the menu>Tools>Options and put a check in the box next to where it says Require Variable Declaration.

Okay, now for your problem. You are checking Form1's windowstate and setting form2's. Is form2 even loaded? If not then the problem may be that you are trying to access the properties of a form that is not loaded.

But this does not make sense so I have to ask. Are you sure you are using VB6 and not .NET or VBA (Excel, access, word)?

SO, if you are sure that you are using VB6 then goto vb's menu>Progect>References and the first four items should be these in this order...

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

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

Seems like user id is a numeric field. Remove the single ticks (') from around your variable.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Search google/yahoo for screen shot vb6. There are at least a half dozen out there and a couple of them have the alternative code just to take a pic of a specific window.

Good Luck

vb5prgrmr 143 Posting Virtuoso

EnumWindows API

Good Luck