Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VbSendMail, Using It Correctly?


Hello, I was wondering how to use the vbSendMail project correctly. I wasn't sure exatcly how to implement it into my project, like which of the files to add and into where, and once that is done, what the actual code to send it (within the form) would look like. I did look at the readme first, but it just confused me more. Thanks again guys!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Vbsendmail
Hi gurus

I am trying to sedn email using the vbsendmail on my VB6 version, I know, I know,"update" but I really would like this to work and here is my problem.

I can send emails internally with or without attachment but for some reason I cant send email to outside the company, we host our own exchange server 2000 and I would like to send email out of my domain, not just within our domain.

here is what I have so far with the help of you guys.


Code:
Dim stringmessage As String
Dim stringmessage2 As String
Dim stringmessage3 As String



' initialize the component
Set poSendMail = New clsSendMail


stringmessage = "test1"
stringmessage2 = "test2"
stringmessage3 = "test3"




poSendMail.SMTPHost = "my server name"
poSendMail.From = "emailaccount@mydomain.com"
poSendMail.Recipient = "outside@hotmail.com"
poSendMail.Subject = "Outside email test"
poSendMail.Attachment = "test.txt"
poSendMail.Message = vbCrLf & stringmessage & vbCrLf & vbCrLf & stringmessage2 & vbCrLf & vbCrLf & stringmessage3

poSendMail.Send

End


Thanks for any help I can get guys

Please Help Me To Use Vbsendmail.dll
i used vbsendmail.dll to send mail. But i could not able to send to gmail.com and yahoo.com. i could able to send mail only to local network.

Using Vbsendmail.dll
Hi All,

Could someone please give me and example using vbsendmail.dll to send emails. I have downloaded the dll and read about how it works great for sending multiple emails but I need to see some code to know how it works.

Thanks,
Nitesh

VbSendMail
Hi all.

Is anyone familiar with sending email from VB applications using the vbSendMail download? I've downloaded the program and it works fine when running independantly. What I'd like to do though is to send an email automatically from an application of mine when a certain function is successfully completed. Should I add the bas/frm files from vbSendMail to my own application, or somehow call the vbSendMail .exe and let it do the work? Or what?

Cheers,

DaveMere

VbSendMail.dll
Hi..
Has anyone used the vbsendmail.dll before? The sample that comes with the zip file and the one that i have created doesnt work correctly. When you send a mail it says that logon is not support, but really it is.. When you open outlook... check your mail. then use the vb program to send the mail.. it works correctly... yet this dll is not supposed to use any third party programs.. Could someone look at the sample code and see if there is anything wrong? Has anyone else experienced this same problem before?

The address is :
http://www.freevbcode.com/code/vbSendMail.zip

Vbsendmail.dll
Hi,
I have this vbsendmail.dll downloaded from net.
Well the the component is fine, is great help fo rsending mail continoulsy.
But if 'mail.server.com' is not avaibale also it keep sending the mails.
What i presume is that is checking the availablility of the DNS only.
so it is sending the mails.
Can any one please help me in this.

Regards
John Philip

Help With VbSendMail.dll
Hello experts!

I am using vbSendmail.dll to send email. I can send internal emails but cant send to an external account (yahoo account, etc). Just wondering why it keeps on returning an error when I start sending to a yahoo account. Does this has to do with security, access or user profiles?

This is the message:

"550 5.7.1 Unable to relay for somebody@yahoo.com"


Thanks in advance.





VBSendMail - Email Not Sent
I have a script that sends emails using VBSendMail. The problem that I am facing is that the scripts works [ie sends an email] from one machine, but when I am using another machine, and kick off the script, an email is not sent out.

On the latter machine, I have registered both vbSendMail.dll and mswinsck.ocx. I searched the registry and they are both there...

Not sure what else to check.
Thanks.


Code:
sub main
Call sendEmail("NAP1SM002", "nadian@company.com ", "Nadia WP", "nadian@company.com", "3othermachine Subject", "xthis is a test:")

end main

Sub sendEmail(host As String, from As String, fromName As String, recipient As String, subject As String, message As String, Optional attachment As String)
'Note: this method needs reference to the SMTP Send Mail for VB6.0
Set poSendMail = New vbSendMail.clsSendMail

poSendMail.SMTPHost = host
poSendMail.from = from
poSendMail.FromDisplayName = fromName
poSendMail.recipient = recipient
poSendMail.RecipientDisplayName = ""
poSendMail.subject = subject
poSendMail.attachment = attachment ' file attachment(s), optional
poSendMail.message = message
poSendMail.Send

Set poSendMail = Nothing 'destroy email objcet
End Sub

VBSendmail Question
Hi Guys,

If I am sending out bulk emails using vbsendmail.dll, whats the max number of mail I can send at a time

VbSendMail Problem
[Resolved] Hi All,

I am trying to use vbSendMail and can't seem to get it to work.

I have registered vbsendMail.dll and mswinsck.ocx and believe that I have everything set up as in thier example. When I step through the program, it does the form open, then the class initialization (hopping into some other subs), then the class terminate and then attempts to do the form open again and fails at
Code:
Set poSendMail = New clsSendMail
with a "Type mismatch" error.

Any idea what I'm doing wrong or how to find the problem?

VbSendMail.dll Causes Crash
I'm using the widely used vbSendMail.dll to add SMTP mail to one of my projects. It was working great until my PC died. I have a brand new PC that's up and running Windows XP with likely all the latests patches from Microsoft.

When I run my application, the class initializes OK and I can connect through vbSendMail.Connect, but when I call vbSendMail.Send I get:

"The instruction at "0x7c901010" reference memory at "0x00000014". The memory could not be "read".

When I look at the details of the report it wants to send to Microsoft it references ntdll.dll as the faulting application.

Is anyone familiar with this particular problem or can you provide some generic troubleshooting advice? I really don't want to have to switch away from the vbsendmail program because there would be a lot of code to change at it's really a great chunk of code.

Also, the vbSendMail comes with a sample application, I tried that and get the same results, so it's something between my PC and the vbSendMail code...I'm just not sure what.

Vbsendmail Question
Hi all,

I am using vbsendmail to send email. Is there any free SMTP server out there which can help to relay the email?

thanks!

Trouble With Vbsendmail
I have been using vbsendmail in a few of my projects. i Had not tested it over a
year. Recently i tested it and it worked fine a couple times and i tried to change the smtp server to smtp.google.com and it would not connect. Now i can not even get it to work thru my isp server.
I have have tried everything unregister vbsendmail.dll & re-register with new dll
I keep getting the same message:
"The attempt to connect has timed out". and no mail is sent
Please help

Vbsendmail Problems
I've downloaded the vbsendmail example from here and the included examples work fine. My problem is that i want to add an email function to one of my existing projects so I added the modMXQuery.bas module and SendMail.cls class module to my existing project. In the form load of my "send email" form i've got the below code but when I try to run the app I get the error User-defined type not defined and the follow line of code is highlighted in the modMXQuery.bas module - poSendMail As vbSendMail.clsSendMail.

Thinking I had to reference the vbsendmail.dll i added a reference to it but then when i run the app i got a "Type Mismatch" error and Set poSendMail = New clsSendMail was the line of code that is highlighted. I then doubled checked the downloaded examples and they don't have a reference to the vbsendmail.dll so i'm at a loss as to why I can't get it to work in my project?

Any suggestions?


VB Code:
Private Sub Form_Load()  Set poSendMail = New clsSendMail End Sub

VBSendMail Problems
Hello,


i'm using VBSendMail to send emails. It works fine, but i have found in some SMTP servers two erros:

Error 1: "550 - Relaying denied"
Error 2 :"504 Mechanism not supported"

what is the solution? or the cause?

Any Problem With Vbsendmail.dll
Has anyone ever had any problem with this dll in their network?
Running XP.
Thanks

Vbsendmail Authentication?
I had the following code using SMTP Send Mail for VB6.0

VB Code:
Set posendmail = New vbSendMail.clsSendMailposendmail.SMTPHost = "smtp.dia.sbcglobal.net" posendmail.From = Trim(strEmail)posendmail.Recipient = Text2.Textposendmail.ReplyToAddress = "User@Comp.com"posendmail.Subject = "monthly statement for " & strCustNameposendmail.Attachment = "C:Statement.pdf"posendmail.Send


This used to work fine. Our email service provider changed some things and my techie tells me that our outgoing mail now requires authentication, it didn't use too.

Is there a way to send authentication using vbsendmail?

Thanks

Vbsendmail Help Needed
I've added the line below into a Module and into General Declarations on the Form. I've changed it from Private to Public and always I get the error:  "Only Valid in Object Module". This seems like a straightforward error to resolve, but nothing I try makes a difference.

Private WithEvents poSendMail As vbSendMail.clsSendMail

Any help with this would be greatly appreciated.

VbSendMail - Crashing
This is the most frustrating problem I have ever encountered... Hopefully someone has encountered it as well and has a solution.

I am using the vbSendMail control to send emails -- I have been using this control for about a year now. I just recently build a new application to email some reports a couple of times per week. I tested the app and it worked fine, sending out the email before it exited. The next day, I ran the app again and VB completely crashed on the 'poSendMail.Send' line. First, I receive this standard error message:

Visual Basic has encountered a problem and needs to close. Blah Blah Blah...

Then I get another message:

vb6.exe - Application Error
'The instruction at "0x7c901010" referenced memory at "0x00000014". The memory could not be "read".


The application which I initially created still works fine and sends out emails without a problem. I copied the entire VB project for my new app onto my second development computer and tested it out. The program worked fine. So it is just my main computer...

~ Mark

VbSendMail Smime
hello
i'm trying to send smime message with vbSendMail but my email is always a multipart message and not smime.

has anybody sent a smime message with vbSendMail (tried with SmtpSend and it works).

thank u

Sending Email With Vbsendmail .dll
hi,

i'm trying to send a simple email using the vbsendmail .dll located on freevbcode.com, but i'm getting a "email relaying not allowed" error back from the server, even on messages sent to myself. has anyone used this dll and gotten it to work? please help! thanks!

How To Log Failed Emails With VBSendmail.dll
Hi Guys,

Say if an email fails with vbsendmail. maybe because the email address was spelt wrong. How can I log that it wasn't sent or that the recipient email is invalid

Sending An E-mail Using VbSendMail
some tiem ago i tried with the vbSendMail dll. it worked fine and it's very easy to use. but i can't get the mail to get to destination because it needs a smtp server and i don't know any. can anyone help me with that? i tried the automatic SMTP search of the dll, but it didn't work on my computer. and because the program is directed to be distributed amongst my clients it would be russian roulette, so i need it to be fixed.

Vb6, Vbsendmail And Multi-langauges
I hope someone can help me with this problem. I have txt file that contians some russian text, the file is already saved as utf-8 encoded (opening the file displays russian correctly). now what I am trying to do is this.

the file contains this html:
TEST FOR RUSSIAN
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML;CHARSET=UTF-8"/>
</HEAD>
<BODY>
<FONT FACE="Arial">

<P>С уважением,

</BODY>
</HTML>


the above is passed as a parameter (see below)
when i read this file in I extract each line, build up a string for the email body.....right, I am reading this file in with :

'====================================
Private Sub EmailFileOpen(strEmailFile As String)
'====================================
Dim strSubFuncName As String
Dim intFileNumber As Integer
Dim strFile As String
Dim strData As String
Dim strTempData As String

strSubFuncName = "frmMain.EmailFileOpen"
On Error GoTo ErrHandler

strTempData = ""
strData = ""

intFileNumber = FreeFile
strFile = app.path & "" & strEmailFile
If Dir(strFile) <> "" Then
Open strFile For Input As #intFileNumber
Line Input #intFileNumber, strData
Do While Not EOF(intFileNumber)
Line Input #intFileNumber, strData
strTempData = strTempData & strData & vbCrLf
Loop
gstrEmailMessage = strTempData
Close #intFileNumber
End If

Exit Sub
ErrHandler:

End Sub


I then use the vbsendmail component, applying the above email string as the email message (i add my own literal string in the subject)

ie dllmail.message = gstrEmailMessage etc etc


finally, after setting all necessary vbsendmail properties I send the email to one of my other email addresses


the mechanics of the whole process work ok EXCEPT that when I open the email as the recipient i get garbage....the russian has NOT been interpreted correctly.

is this because my html is incorrect or is it a potential flas with email clients (outlook express etc ) . please can someone help me out - to get the russian out of my text file , into an email, sent...received and opened as russian text.

any help would be appreciated
Gaz

Send Rtf In Body Of Vbsendmail
I have a vb program that contains an address book that sends emails using vbsendmail
How can i change the multiline textbox as the emails body to an rtf and send it?

VBSendMail And Yahoo/Gmail
Hello all,


i use VBSendMail; but i con't use this dll to send emails to yahoo and gmail.


There are a way to use VBSendMail with this SMTP servers?


Thanks!

Vbsendmail Embedded Images
I'm just writing a thing to send html mail using vbsendmail. To get the images to embed I have to attach them. Is there a smart way of extracting all the images from the html short of looping through using Instr? I need the full image location in the html too as I may have to change them from relative to absolute addresses.
ta

www.accuflight.co.uk
www.lettersdirect.co.uk
www.trelliscoaching.com
www.fengshuimarketingcenter.com
www.ourhouseinportugal.co.uk


VbSendMail Timeout Problem
Hi All,

I have an application which checks a table in the database & if that table has records it sends mails as per the data in tha tables.

My application uses vbSendMail.dll to send mails.

The problem is that when there are more records in the table vbSendMail gives me error "Timeout occured", "The SMTP host did not respond to the request"

Can some one help me

thanks,
Pravin



Edited by - pravin_mah on 7/28/2004 6:39:26 PM

Sending Email Using WinSock (vbSendMail.DLL)
Hello, ive got a VB application currently developed that checks the timestamp of a logfile every X seconds. If the file hasnt been updated in a specified interval, it sends a netsend to me.

Ive been asked that instead of the netsend, to send a simple email alert w/out attachement.
Now the machine that this will be running on will not have a profile set up, so using an outlook object, or using CDO/MAPI isnt an option. Ive found another way using WinSock Controls, that seems fairly straight forward:
http://www.freevbcode.com/ShowCode.Asp?ID=109

Ive downloaded the zipfile, include the .DLL in my project and followed the directions, although instead of getting the mail properties from the form, ive just hard coded it: SO my code looks like this:



----

Option Explicit
Option Compare Text
Private WithEvents poSendMail As vbSendMail.clsSendMail


Private Sub Form_Load()

Set poSendMail = New clsSendMail
Send_Mail

End Sub


Private Sub Send_Mail()

'Assumes you have a form with text boxes named as below

poSendMail.SMTPHost = "" ' fill in, or use localhost if u have your own smtp server
poSendMail.SMTPPort = "25"
poSendMail.From = "" ' fill in sender address
poSendMail.FromDisplayName = "" ' fill in sender name
poSendMail.Recipient = "" ' fill in receiver address
poSendMail.RecipientDisplayName = "" ' fill in receiver name
poSendMail.Subject = "ERROR TEST"
poSendMail.Message = "This is a generated message. Do not reply"
poSendMail.Send

End Sub


-----


Ive tried using both the SMTP server at my work, and also setting up an SMTP server (easy smtp server 2.5) on my home machine, but have not had any luck. The code compiles and runs without any errors, but not receiving an email.
Anyone know of a simple way to send an email using vb6 using winsock controls, or why the above isnt working? If youve got vb, dl that .dll and try out the code (just fill the parts above). Seems odd it wont work

I'm fairly new to VB, so thanks for any help.

VbSendMail Character Set: Iso-8859-1 --&gt; Big5
In vbSendMail, the Char_Set constant is set to "iso-8859-1".

How would you go about setting the character set to big5 instead?  

Thanks,
- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
www.MilletSoftware.com

Sending Of Emails Using VbSendMail.dll With Charset
Dears

Sending of email with that dll is very familiar, but how do I have to set of charset to polish language? At the moment automatically enconding with western europe charsets gives mails bad chars. I need to have in mails:

This is a multi-part message in MIME format.

Code:------=_NextPart_000_0108_01C6387B.8BDB3650
Content-Type: text/plain;
    charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable


Who knows? I can't find out that proprty in dll


Regards
P.

How To Save Vbsendmail Attachment To Mysql Database
Hi Guys,

vbsendmail takes the path of an attachment like this:


Code:
C: ext.pdf


How can I save that attachment to my MySQL database. I know I will use a blob datatype but how do I save that attachment.

Need Help With Vbsendmail My Server Required A Username And Password
need help with vbsendmail my server required a username and password to send a email. where and what do I add to my code to do this?

Error 421: Too Many Errors When Sending Bulk Mail With Vbsendmail.dll
Hi, I'm using the vbsendmail.dll from freevbcode.com and have a problem when sending bulk mail. The thing is that I develop an application that extract records from an access database which contain all the information of the recipients to which I'm sending e-mail, and before sending the bulk e-mail, I simulate a mail merge and then begin sending the e-mails, vbsendmail.dll has the methods of connect and disconnect for sending bulk e-mails and I have a loop until the end of file of the recordset, I get the following error when sending to a recordset with 2,000 e-mails and in some part perhaps in the e-mail 1,010 for example:

error 421: too many errors

Does anybody know how can I Fix this?

Multiple Attachments With VBSendMail (SMTP Send Mail For VB6.0)
Hello everyone. I am using SMTP Send Mail for VB6.0. Everythig works great except I am only able to send one attachment at a time. Does anyone know how I can send 2 attachments with an email using this component?

Here is my code.
VB Code:
poSendMail.Subject = "Profit and loss statement."poSendMail.Attachment = "C:P&L-" & Trim(Reports.Combo3.Text) & "-" & Trim(Reports.Combo1.Text) & ".pdf"poSendMail.Attachment = "C:ServiceAnalysis-" & Trim(Reports.Combo3.Text) & "-" & Trim(Reports.Combo1.Text) & ".pdf"poSendMail.SendSet poSendMail = Nothing

The preceding code just sends the 2nd attached file, not the first one.
I also tried posendmail.attachment file1 & "," & file2. This doesn't work either. I also tried it with a semicolon instead of a comma.

Thanks

Vbsendmail.dll Access 2003 "Active X Component Can't Create Object"
Hello.  I have been using vbsendmail.dll (I have the latest version of this file as well) in my Access 2000 VB Module for years and it works great.  I have a scheduled task that runs every morning and sends out about 20 different emails using the smtphost.  We have upgraded to Access 2003.  When the module starts to run the "Active X Component Can't Create Object" pops up.  I have gone thru all the help regarding this error.  When I try to use Regsrv32 there is an error: DllRegisterServer in C:windowssystemvbsendmail.dll failed.  Return Code is 0x80004005.  Any help on this would be greatly appreciated.  I just like the way this ran with no problem for so long and it would be ashame to have to go to something else but I am open to suggestions as well.  Thanks!

VbSendMail App And "STARTTLS" Error
Searched many of the threads here for the solution to this, but came up empty...

When using vbSendMail, I came across the error:
"530 5.7.0 Must issue a STARTTLS command first"

So, I read the "solutions" others suggested and no avail. From my research I see that StartTLS is essentially the SSL security of my email. I tried to turn it off in Outlook Express, but no luck there.

I tried to turn on the "login" button, and the "POP3 login" button, then BOTH turned on in vbsendmail, but again, nothing

So the question is: how do you issue a STARTTLS command?

App Not Installing Correctly
Hi there,
I have been developing this application from the past 3 months or so. Now that it is finished I tried installing it in my home PC. But itz not getting installed correctly. It says unable to register MSADOX.dll. And when I try running the app, it says 'Module not found' pointing to the following code...


Code:
'Check if Table already exists in database
TableExistsFlag = 0
Dim cat As New ADOX.Catalog
Dim X As Integer
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Statistics.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
For X = 0 To cat.Tables.Count - 1
With cat.Tables(X)
If .Type = "TABLE" And UCase(Left(.Name, 4)) <> UCase("msys") Then
If LCase(cat.Tables(X).Name) = Trim(LCase(DataSetNameText.Text)) Then
TableExistsFlag = 1
Exit For
End If
End If
End With
Next

Set cat = Nothing
'Table Check over
what might be the problem? i guess itz got to do with MSADOX.dll's version..am i right??:wall:
plz reply
praveen

If Else Not Choosing Correctly!
If RichTextBox1.SelFontName = Null ThendlgCommonDialog.FontName = ""ElsedlgCommonDialog.FontName = RichTextBox1.SelFontNameSo if there are actually two different fonts selected in the textbox, it sets the font to "", otherwise the font dialog displays the font of the selected text in the textbox.

But this isn't working, VB6 gives me an error saying incorrect use of Null. When I hover over RichTextBox1.SelFontName, it says it's value is Null! But it is choosing to follow the Else Statement. What is going on?

&lt; And &gt; Not Working Correctly
Umm... I have a range of cells that I'm looping through, and when I find a value that is over $1000 I have a variable that I incriment by one. The problem is, it picks up ANY value, regardless of whether it's over $1000 or not. I know this is probably something simple...



x = 0: row = 7: col = 11: FirstW = 0: SecondW = 0: ThirdW = 0: FourthW = 0
'Calculate How Many over 1000
For x = 0 To 175
If myXLSheet.Cells(row, col) = "1st" And myXLSheet.Cells(row, col - 3) > "1000" Then
MsgBox myXLSheet.Cells(row, col - 8) & " Appears to be Over $1000 " & "@ " & myXLSheet.Cells(row, col - 3)
FirstW = FirstW + 1
End If
If myXLSheet.Cells(row, col) = "2nd" And myXLSheet.Cells(row, col - 3) > "1000" Then
SecondW = SecondW + 1
End If
If myXLSheet.Cells(row, col) = "3rd" And myXLSheet.Cells(row, col - 3) > "1000" Then
ThirdW = ThirdW + 1
End If
If myXLSheet.Cells(row, col) = "4th" And myXLSheet.Cells(row, col - 3) > "1000" Then
FourthW = FourthW + 1
End If
row = row + 1
Next x

I put the message box in the first if statement to see what in the world it was doing, and sure enough, it was picking up values of less than 500 and values over $1000

Anyone see why?
I forgot to mention, the range of cells is formatted general number

Is This Loop Correctly?
Hello, Everyone:
I wonder whether I can loop the arrary lik this:

Code:
dim rack[9] as integer
dim n as integer 'n will less than 9
dim i as integer
input n
for i=1 to n
'pop up a window to get input
rack[i]=text1.text
next
Thank you very much!
Charlie

How To Write DBF Correctly With ADO
HI!
I'm try to write a DBF file with data from Access using ADO.
The problem is that the driver (I suppose) write de ASCII sequence 94-163 at the end of all fields names, and them the file can't be read with any other utility ("invalid alias in colum") to do this.

Any contribution welcome!
thanks

Why Isn't This Working Correctly?
Set dbrs = dbConn1.Execute("SELECT OrderDate, [Job Address], Street, ID, JobComplete FROM Orders INNER JOIN ServiceOrders ON Orders.[Lighthouse Job No] = ServiceOrders.JobNo WHERE [Lighthouse Job No] IN (SELECT JobNo FROM ServiceOrders WHERE JobComplete = False)")

It works, I get the information from the two seperate tables, just like I need, but it gives me both the service orders that are complete and incomplete. (JobComplete = False and JobComplete = True). The JobComplete field is a checkbox. How can I fix this so I only see the incomplete service orders??

Thanks in advance.

Correctly Use Of Function...
Hi, i have a function that there is supose the return the path of a registry key or something like that, the problem is that im having trouble to use it correctly, im posting all the code......can some1 help?

Help Saving Correctly
I need help saving correctly. When my code saves it auto. puts " before and after the saved text...How can i fix this?

Using XmlHttp Correctly
hello.

I use xmlHttp requests to send various xml pages to various asp pages on servers, no worries here, my only concern is that i am not using this method the best way.

In order to ensure the asp page has procesed correctly I do a response.write with some output text, but when i try to gain the asp response from the client

(xmlHttpRequest.ResponseText)

i get an error saying the data is not yet available.

any suggestions would be very welcome.

Thanks.

Not Computing Correctly
i have this code in my Amountdue textbox
VB Code:
For i = 1 To lstStocks.ListItems.Count      cAmountDueTemp = CCur(cAmountDueTemp) + CCur(lstStocks.ListItems.Item(i).SubItems(5))      txtAmountDue.Text = Format(cAmountDueTemp, "###,###,##0.00")    Next

this one is on lostfocus event of cashpayment
VB Code:
Private Sub txtCash_LostFocus()  txtCash.Text = Format(txtCash.Text, "###,###,##0.00")End Sub

and this is how i compute for the change
VB Code:
If txtCash.Text = "" Then    MsgBox "Please Pay the amount of Php " & txtAmountDue.Text, vbInformation, ProgName    txtCash.SetFocus    Exit Sub  ElseIf Val(txtCash.Text) < Val(txtAmountDue.Text) Then    MsgBox "Cash Payment is less than the Total Amount Due.", vbInformation, ProgName    txtCash.SetFocus    SendKeys "{home}+{end}" 'Highlight text    Exit Sub  Else    txtChange.Text = Format(Val(txtCash.Text), "###,###,##0.00") - Format(Val(txtAmountDue.Text), "###,###,##0.00")


why is it that if the value in Amountdue textbox is 1,012.00 and i typed 500 in my cashpayment textbox and then when i click the button for computation is not correct it should display "Cash Payment is less than the Total Amount due" instead is display you change is 499.

What is happening here?

Using Datediff Correctly
Hi,

i had a ISEXPIRED function i got from psc years ago, im not using a pc so cant paste it...but i just need help to use it realy.

for a = 0 to maxusers
user(a).date = checkdate
user(a).time = checktime

if isexpired(checkdate, checktime) then
msgbox "your seeing this because it has expired"

next a

- basically...im not sure how to input the date and time...when i save users accounts...the date format in the file is like 2006-01-21 ..im not sure how it and the time is suppose to be like.

plz help

Why Isn't It Calculating Correctly?
Hey everybody, almost done my WaWa hoagie project and just have one problem left:


VB Code:
Private Sub Command1_Click()Dim lasubtotal As DoubleDim latax As DoubleDim latotal As Doublelasubtotal = Round(larollprice + latoppingtotal + 5.99, 2)latax = Round(lasubtotal * 0.06, 2)latotal = Round(latax + lasubtotal, 2)latotallbl.Caption = "The total is " & latotallasubtotallbl.Caption = "The subtotal is " & lasubtotallataxlbl.Caption = "The tax is " & latax End Sub


for some reason it won't add the larollprice and latoppingtotal from my other forms, even though I declared them as public. So every time lasubtotal caption just reads 5.99 (a number I put in for part of the lasubtotal equation) and the latax works correctly. The latotal shows the correct addition for latax and lasubtotal. The problem is the subtotal never shows the correct amount, anyone know what I'm doing wrong?

Copyright 2005-08 www.BigResource.com, All rights reserved