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




Stop Code From Moving On If "IF" Statements False [Solved]


hi, i want to verifi the first two boxes before it moves onto the rest of the code so if any of the first two if statements are false it doesnt move onto the rest of the code, any 1 have any ideas?

thx much appreachiated


Private Sub cmdcal_Click()

If cboCars = "" Then MsgBox "Error Msg Here"
If txtdays = "" Then MsgBox "Error Msg Here"

lbltotal = lblPrice * txtdays
lbldeposit = (lbltotal / 100) * 20
lblPay = lbltotal - lbldeposit

End Sub




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
System.Timers.Timer Hangs On Stop() And "Enabled = False"
Hello,

I have created a Windows Service that dynamically loads a class PluginMain from an assembly and instantiates it. It then calls PluginMain.Execute() which creates a timer declared as Private pTimer As System.Timer.Timers. When the Service is stopped, it calls PluginMain.End(), which calls pTimer.Stop() (to stop the timing events from occuring), but this method hangs for unknown reasons. I tried setting "pTimer.Enabled = False" and pTimer.Dispose() too, which results in the same (Service hangs on status of PausedPending, in the pTimer.Enabled = False line).

I found a solution in setting pTimer to Nothing (pTimer = Nothing), but this is of course not very pretty. Anyone able to isolate the problem?

In the service:
Code:
Private pPlugin As IPlugin    ' Interface I declared to define plug-ins. Provides the Execute() and End() methods.

Protected Overrides Sub OnStart(ByVal args() As String)
    pPlugin = PluginLoader.Load("<FILENAME>")    ' PluginLoader loads the PluginMain class from an assembly when it implements IPlugin.
    pPlugin.Start()
End Sub

Protected Overrides Sub OnStop()
    pPlugin.Stop()
End Sub


In the plug-in:
Code:
Class PluginMain
    Implements IPlugin

    Private WithEvents pTimer As System.Timers.Timer
    Private I As Integer = 0

    Public Sub New()
    End Sub

    Public Sub Execute() Implements IPlugin.Execute
        pTimer = New Timer(5000)
        pTimer.Start()    ' This works...
    End Sub

    Public Sub End() Implements IPlugin.End
        pTimer.Stop()    ' This hangs...
    End Sub

    Public Sub Timer_Elapsed(sender As Object, e As ElapsedEventArgs) Handles pTimer.Elapsed
        System.IO.File.Create("C:TESTTEST" & I & ".TXT")    ' Just for testing...
        I += 1
    End
End Class

[RESOLVED} Need VBA Code To Set Field's Enabled Property To "false"
I need vba code that will set the enabled property of a field named "Remarks" to "false" if data is present and leave it "true" if it has no data. This is an Access 2000 database (Flat file).

Thanks

Carbo

Solution:

Private Sub Form_Current()
If IsNull(Remarks) Then
Remarks.Enabled = True
Else
Remarks.Enabled = False



End If


End Sub

Need Code To Search 4 Frames To See If It Is "visible = False"
Private Sub File1_DblClick()
If viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic1.Show
viewpic1.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic1.Show
viewpic1.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = True And viewpic4.Visible = True Then
viewpic1.Show
viewpic1.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = True Then
viewpic1.Show
viewpic1.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = True Then
viewpic1.Show
viewpic1.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic1.Show
viewpic1.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = False And viewpic4.Visible = True Then
viewpic1.Show
viewpic1.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

'viewpic1 stops here

ElseIf viewpic1.Visible = True And viewpic2.Visible = False And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic2.Show
viewpic2.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = True Then
viewpic2.Show
viewpic2.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = False And viewpic3.Visible = False And viewpic4.Visible = True Then
viewpic2.Show
viewpic2.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic2.Show
viewpic2.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = False And viewpic4.Visible = True Then
viewpic2.Show
viewpic2.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = True Then
viewpic2.Show
viewpic2.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic2.Show
viewpic2.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

'viewpic2 stops here

ElseIf viewpic1.Visible = True And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = True Then
viewpic3.Show
viewpic3.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)


ElseIf viewpic1.Visible = True And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic3.Show
viewpic3.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = False And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic3.Show
viewpic3.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic3.Show
viewpic3.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = True Then
viewpic3.Show
viewpic3.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = False And viewpic4.Visible = True Then
viewpic3.Show
viewpic3.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic3.Show
viewpic3.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

'viewpic3 ends here

ElseIf viewpic1.Visible = True And viewpic2.Visible = True And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic4.Show
viewpic4.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = False And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic4.Show
viewpic4.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic4.Show
viewpic4.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = True And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic4.Show
viewpic4.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic4.Show
viewpic4.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = False And viewpic3.Visible = True And viewpic4.Visible = False Then
viewpic4.Show
viewpic4.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

ElseIf viewpic1.Visible = False And viewpic2.Visible = True And viewpic3.Visible = False And viewpic4.Visible = False Then
viewpic4.Show
viewpic4.Picture = LoadPicture(Dir1.Path & "" & File1.FileName)

'viewpic4 ends here

End If
End Sub



Help.. I manually typed out every posible variable .... what all this does is makes it so if ANY frame (viewpic1,viewpic2,viewpic3,viewpic4) is not visible it will load the picture in it and open it... HELP... now when I try to open a picture... the frame dont show up and nothin loads.... what I am trying to do is make it so it searches all four of my frames for one that has the properties of visible = false.... and if there is more then 1 with that property then it picks one and only ONE

About "CVMichael's SHA1 Class In VB Code" -clsSHA[Stop Discussing]
VB - 128, 160 and 256 Bit File Encryption/Decryption with MD5, SHA1 and SHA256 http://www.vbforums.com/showthread.p...highlight=sha1

I study SHA1 algorithm recently.I find there is a problem in CVMichael's SHA1 class --clsSHA.
Using The code snippets:

Quote:





Dim S As New clsSHA

Text1.Text = S.SHA1(("0000001804289383" & "testuser98")
'Debug.Print S.SHA1("0000001804289383" & "testuser98")





I cant get correct hash value:"D87CC36B668E3C1E0BE60F7AF98EB8FA609056CA",but "87E786EF2003BF2CCD6349B45E0770E539F85E52".

Now I found the clsSHA work good when the STRING length "<=16 and >=32",but cant work correct when the STRING length ">16 and <32". Anyone found the problem?? Or it is my system's problem??

A Stupid Problem: "Error Accessing The System Registry" ("Solved") Thank You
This is a very silly problem. I tried to have a look of References from Project dropdown menu, it returned a critical error:

"Error Accessing the system registry".

I reinstalled VB6 but it seems that the problem still exists. Anybody please tell me how to solve the problem.

thanks in advance





Edited by - kenyiwei on 5/6/2004 2:07:51 AM

SQL Query That Returns Records From "Now" Minus 12 Months "m" [SOLVED]
I can't figure out how to structure an SQL query to return records from an Access 2000 database based on dates using "Now" minus 12 months to find the beginning month of the 12 month date range;

example:

Now = 8/24/2005

minus 12 months = Beginning month for date range or 7/2004

return all records from 7/2004 to 8/2005

something similar to this post http://www.vbcity.com/forums/topic.asp?tid=108990 but the dates are based on Now minus 12 months so that there is NO user input to determine the 12 month date range.

_________________________________________________________________

Edited by - vbprog1144 on 8/25/2005 4:32:58 PM

Moving A Record From "inventory" Table To "trash"
Hi All,

I am trying to create a "Trash" button instead of a "Delete" Button which first copies the record to another table and then deletes the record.

I am trying with the code below but its not working and gives Run-Time Error '91' -"Object variable or With Block variable not set" the very first time in "Adodc2.Recordset.AddNew" line :

Adodc1 is connected to the "Inventory" table and Adodc2 is connected to the "Trash" table. Both tables have the very same fields in the same order. Remamber the records are being deleted from the Inventory table (which will never have 0 records). I have also programmed the delete from the "trash" which works fine. My BIGGEST problem is copying a particular record from the Inventory table to the Trash Table.

Private Sub cmdtrash_Click(Index As Integer)
Adodc2.Recordset.AddNew
Adodc2.Recordset("ID") = Adodc1.Recordset("ID")
Adodc2.Recordset("Site") = Adodc1.Recordset("Site")
Adodc2.Recordset("Address") = Adodc1.Recordset("Address")
Adodc2.Recordset.Update
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext

PLEASE HELP...... I AM DEAD STUCK

If I Use "SaveSetting App.Title, "Settings", "Font", "001122"" - Save Date In The Registry, Where Ca
If i use "SaveSetting App.Title, "Settings", "Font", "001122"" - save date in the registry, where can i find the value saved in the registry? Thanks

"The Case Of The Disappearing Controls" By Cat "SOLVED"
controls in question: picture box and MSChart

log file messages:

Line 20: Property OleObjectBlob in chtBGCurveChart had an invalid file reference.
Line 17: Cannot load control chtBGCurveChart.
Line 34: Property Picture in Picture1 had an invalid file reference.

senario: each time I open the project I get these errors. I've changed the location of the original image used and even renamed it. But, I deleted the original picture box control and pointed to the new image name and location. That didn't take care of it.

And the chart control problem may have originated from renaming the form. But a new chart control added to the renamed form should work! Oh, and I also renamed the chart control.

All code is reflecting the renamed controls, form, and images.

The problem still persists.

Cat

Correction: the picture box control does not disappear -- it simply does not load the image. The chart control does disappear.

VB Equivlent To Php's Str_replace("REPLACE ME", "With ME"... *solved*
What is it?:


PHP Code:




$Output = str_replace("REPLACE ME", "With ME", $input);







There is a built in VB Code which does this right?

IE:

I have a text file with address's:

http://MySite.com/File.php?Name=[Name_Here]&EMail=[Email_Here]

I want to replace :
[Name_Here] With me.txtName.text
[Email_Here] With me.txtEMail.text

How do i do this?

(BTW, I know how to do line by line, i jst need the replace)

TNX

Simple Question &gt; Change "lower Case" To "UPPER CASE" -solved-
hey yers, if i have a ton of text, which is lower case, how can i change it all to upper case?

whats the funtion for this?

TNX

How To Change All Cells Format Type From "General" To "Text" Using VB Code
Hi Guys,
I am new to VBA. If you see my code below, it gets the name from user to insert a new sheet into existing work book. Now, when I create this new worksheet, I want to change their all cells format from "General" to "Text". In that case, whatever I add it is saved as "text" not number or general.

How can I do that? Please help me.


Code:
On Error Resume Next
Dim count As Integer

If txtNewSheet.Text <> "" Then
wbDpiFavorites.Sheets.Add

' Get the sheet with the name selected in the Sheet combo box.
Set shtFavorites = wbDpiFavorites.Sheets.Item(1)

shtFavorites.Name = txtNewSheet.Text
cmbSheet.AddItem shtFavorites.Name

cmbSheet.ListIndex = cmbSheet.ListCount - 1

wbDpiFavorites.Save
Set shtFavorites = Nothing
End If

Can't Stop Writing These Stupid """"
I think my problem is that I'm trying to write a string to a text file, and VB must automatically add the "" to the front and back of any string when writing it to a text file. Is there a way to keep this from happening? I tried trimming the quotes off before writing but no luck. Maybe I'm doing something wrong.

VB Code:
Dim textfileData As String Open Filename For Output As #1    textfileData = Replace(textfileData, Chr$(34), "")    Write #1, textfileDataClose #1

Any suggestions?

Fast && Efficient "BMP" -&gt; "Compressed Image" Converter Code
Since now that my scren capturing program is working the way it's suppose to, I'll keep the issue seperate.

I just need a converter that can be used in a timer and not drain the system resources. Like a simple function without all the hassel of adding classes and subs into modules and then calling the primary DLL that does the compression.

Bmp2Jpg.dll drains my resources so this is why I'm asking for something better or the raw code to actually compress BMP's to JPG (Binary open, Ubound, etc.)

Any help?

Simulating "Send To Back" And "Bring To Front" With Code
On my form, I'm creating a lot of controls on the FormLoad event. Is it possible to "Send to Back" and "Bring to Front" using code? Thanks.

-JB

How To Make Appear A List Of Options From A Function (like "true False" Of Booleans)
When we use a Function like Msgbox we see that appear a "list" or cascade "list" of options to select like "Information, Warning, OKCancel, etc." or other example is when we use a boolean variable. When we asign the value appears a little cascade with de "True, False" options...

My question is What can I do in the elaboration of the Function (any Function) to make appear the options I need in a cascade...


Please...Help...

Luis

Difficult? Manipulating Power Point Files When ".visible=false"
I can't find good info on power point automation. I'm trying to take a .ppt file and save it as another format using the powerpoint.application object.

I can do it IF I set the '.visible' property to true, then use the object.presentations.open method to grab the file. However, I do not want to show the powerpoint application. When I run the program with the '.visible=false' I get a message 'Object must be visible'

I also tried the Open method, with the following syntax:
expression.Open(FileName, ReadOnly, Untitled, WithWindow)

with 'withwindow' set to false, however the saveAs method I use later results in a "Application unknown member, no active presentation" since the saveAs format:

expression.SaveAs(Filename, FileFormat, EmbedFonts) seems to require an active presentation that is NOT active when the application.visible is false.

Moving "*.xls" In A Folder Except "notme.xls"
This is the code I'm using to copy all xls files in a folder to a new one and to then delete the ones in the original folder.

My problem is that there is one xls files in that original folder that I want to keep there.

Is this possible?

Absolute beginner here, so simple answers (other than yes or no) would be greatly appreciated.

Thanks

GH

Sub MoveMultiple()

Dim T As String
T = Dir("C:Profit~1Testin~1*.xls") 'Specify Path and get first file
Do 'loop until all files read
If T <> "" Then 'Make sure a file has been found
FileCopy "C:Profit~1Testin~1" & T, "C:Profit~1Movedt~1" & T 'copy the file
End If

T = Dir 'Get the next file
Loop Until T = "" 'If there is no next file exit loop

Kill "C:Profit~1Testin~1*.xls"

End Sub

Difference Between "If A = False Then" And "If Not A Then"
Hello!

Is there any speed-wise difference between these two statements:


Code:
If A = False Then

Code:
If Not A Then

Regards,
Sebastian

Mark "required" Property Of Fields To False
Hi,
When I create a new table using this:


Code:
' Create the new database.
Set cat = New ADOX.Catalog
cat.Create _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FileName & ";"
Set m_Connection = cat.ActiveConnection

Set tbl = New ADOX.Table

SQL = "SELECT * FROM t_Corrispettivi WHERE IDCorrispettivo = 0"
Set rst = SkiApp.SWDB.DataServer.OpenRecordset(SQL, True)

tbl.Name = "t_Corrispettivi"
For Each fld In rst.Fields
tbl.Columns.Append fld.Name, fld.Type, fld.DefinedSize
Next
cat.Tables.Append tbl

I come up to have all the fields in the table marked as "Required"... have someone an idea of how can I change the "Required" property to false from VB Code?

many thanks

JkC

Excel VBA "Collate = False" Do Not Work !
Hi All
I got a excel sheet with different adresses, set up as different pages when printing. - result of user input.

Problem: I would like it to print the same page x times before going to next. 111,222,333,444 and so on.
When manualy selecting print and no collate it works. But i can not get it to work via VBA. (No difference what i do to collate:=False or true)



Here is the part of the code i use to print.

Pleaaaase help . Chears jesper
Ohh. i tried it in excel 2003 and 2007

Part VBA code:
'Kuvert print

Sheets("Kuvert rækkefølge").Select
Cells.Select
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.196850393700787)
.RightMargin = Application.InchesToPoints(0.78740157480315)
.TopMargin = Application.InchesToPoints(5.51181102362205)
.BottomMargin = Application.InchesToPoints(1.18110236220472)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With

With Selection.Font
.Name = "Arial"
.Size = 26
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

' removing "Empty" output.

Sheets("Kuvert rækkefølge").Select
Cells.Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$C$632").AutoFilter Field:=1, Criteria1:="<>*tom*" _
, Operator:=xlAnd

' select numbers of print per page----- remember (Dim NumCopies As Long) in start.
NumCopies = Sheets("forside").Range("c5")
'Printing

Application.ActivePrinter = "Epson EPL-5000 på LPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=NumCopies, ActivePrinter:= _
"Epson EPL-5000 på LPT1:", Collate:=False
' removing filter

Sheets("Kuvert rækkefølge").Select
Cells.Select
Selection.AutoFilter

VB Equal To The Javascript "return False"
How could I make VB do "return false" as in javascript
something like this
<body onContextmenu="return false">

but in vb

How Can I Successfully Use The ".ShowInTaskbar = False" Property....
How can I successfully use the ".ShowInTaskbar = False" property, successfully preventing my application from showing in the Windows Taskbar?

I was trying to use "frmBrowser.ShowInTaskbar = False" from with inside the Form_Load(), but all I would get was this message: "Compile Error- Can't assing to read-only property."

Please if anyone knows how to prevent an application from loading into the Windows Taskbar, please help me out, Thanks
Daniel Christie

Solution&gt; Error: """"&&H8007007E (-2147024770) The Specified Module Cannot Be Found"""
Hello

This is the error what i am getting after installing a package of one of my module on user testing machine.
The same module being working fine on others.


What can be the reason for this and what can be the probable solution for this?

Sandeep

Make "DoEvents" False
Hi During a FOR NEXT loop I want to toggle whether it Does the events or not depending what happens, but I dont know how to 'switch it off' when it has exectued the DoEvent command once!

Method "SaveAs" Or "Save" Of Object "Excel.Workbook" Does Not Work.
Hi people.
I did for a long time a program that uses excel automation, so that from a template will create a final file with some data pulled from the database (with ADO). At the end and when the Excel file is ready to be saved I got in a couple of computers some problems. In the whole LAN have XP, but in these 2 computers we have SP2. I have checked the rights and are OK (I have even tried to save the Workbook under the Temp folder and also the same problem).
Working with Office 2003 (SP1).
I have searched in internet about any bugs but I don´t find anything.
Any ideas.
Thanks for your time
Jaime

Catching SQL Server T-SQL "PRINT" Statements Via ADO
Heh. I'm asking a question instead of answering one... I think I'm in shock.

I'm trying to figure out how to catch the T-SQL "PRINT" statements for SQL Server calls, which could be in either in the query text or in an executed stored procedure. These are often used by folks for debugging purposes, and I am in the process of writing a query window / SQL Server client application.

The only thread I could find which directly related to my issue was this one from 2000, which never received an answer: http://www.xtremevbtalk.com/show...L+server+print

I looked in the pError, pRecordset, and pConnection objects passed in the connection object's "ExecuteComplete" event and can't find this text anywhere. Its not returned in the recordset, and its not returned in the Errors collection... so how am I missing it?

Thanks
-G

How To Replace "Apple" With "Banana" In A String That Contains "Orange" In A TXT File
Whoa! Long thread title. Basically, how can I search for any string in a text file that contains "Orange", then replace "Apple" with "Banana" in that same string? Is this difficult? Thanks!

Data1.RecordSource = "select * From Salary Where &#22995;&#21517; Like " + S + " " * ""
Data1.RecordSource = "select * from salary where 姓名 like " + s + " " * ""
thanks in advance gentlemen and ladies..
firstly...I don't know what must add "++" between "s " variant..
who can tell me why?? thanks , ,, I really don't know why it does this..
maybe i am a beginner..please forgive me why add ++ between s..thanks

How To Change Boolean Field From Displaying "0" And "-1" To "Yes" And "No"
Hey there,

I have a data report, which displays a few fields from an Access table, one which is a boolean. At the moment if the boolean value is True, then on the data report it displays "-1", and if False "0".

How can I change this so it displays "Yes" if true and "No" if False?

Would be really grateful for any help.
Thanks.

Nested "IF" Statements Not Working.
VB Code:
'Check Main Category to see if any boxes are checked.If cbDOB.Value = vbchecked Or cbInitials.Value = vbchecked Or cbHomeAddress.Value = vbchecked Or cbHomeWorkPhone.Value = vbchecked Then        'Date of Birth    If cbDOB.Value = vbchecked Then    MsgBox "DOB Checked"    End If        'Initials    If cbInitials.Value = vbchecked Then    MsgBox "Initials Checked"    End If        'Home Address    If cbHomeAddress.Value = vbchecked Then    MsgBox "Home Address Checked"    End If        'Home and Work Phone    If cbHomeWorkPhone.Value = vbchecked Then    MsgBox "Home Work Phone Checked"    End If     End If


It is not giving me an error, however it is not popping up any msg boxes when the corresponding checkboxes are checked.

How To Get Rid Of The Msgbox Saying " File Existed Replace It?" When Using The Code "objWorkbook.Sav
Excel - how to get rid of the msgbox saying " file existed replace it?" when using the code "objWorkbook.SaveAs App.Path & " est.xls"

thanks a lot!

Output Is Always "False"?
Hey all, I'm new here, not sure if this is the right place to post this, but here goes.
I need some help in Microsoft Visual Basics 6.0. Here is my layout so far.

My Layout

Note: txtFirstType, txtFirstAmount, txtSecondType, txtSecondAmount and txtName are the names that I assigned to the respective text boxes.

Here is my program for my "Receipt Button" (circled in red in the picture)

Dim iChocolate As Integer
Dim iVanilla As Integer
Dim iMint As Integer
Dim iBeforeTax As Integer
Option Explicit

Private Sub cmdReceipt_Click()

If txtFirstType.Text = "C" Then
iChocolate = Val(txtFirstAmount.Text)
ElseIf txtFirstType.Text = "V" Then
iVanilla = Val(txtFirstAmount.Text)
ElseIf txtFirstType.Text = "M" Then
iMint = Val(txtFirstAmount.Text)
End If

If txtSecondType.Text = "C" Then
iChocolate = Val(txtSecondAmount.Text)
ElseIf txtSecondType.Text = "V" Then
iVanilla = Val(txtSecondAmount.Text)
ElseIf txtSecondType.Text = "M" Then
iMint = Val(txtSecondAmount.Text)
End If

lblOutput.Caption = "Customer's Name : " & txtName.Text _
& vbNewLine _
& "Chocolate Cookies = " & "iChocolate" _
& vbNewLine _
& "Vanilla Cookies = " & "iVanilla" _
& vbNewLine _
& "Mint Cookies = " & "iMint" _
& vbNewLine _
& "Subtotal = " & iChocolate * 5.99 + iVanilla * 5.49 + iMint * 6.49 _
& vbNewLine _
& iBeforeTax = iChocolate * 5.99 + iVanilla * 5.49 + iMint * 6.49 _
& "PST For Order = " & iBeforeTax * 0.08 _
& vbNewLine _
& "GST For Order = " & iBeforeTax * 0.07 _
& vbNewLine _
& "Grand Total = " & iBeforeTax * 1.15
End Sub


Now the problem is that after I run my visual basics program, no matter what input I enter in the text boxes, my lblOutput textbox is always False. The only thing it shows is the word False after I click on the Recipt Button. What I'm trying to do is make something like the following appear in the Output label:

Customer's Name : James
Chocolate Cookies = 5
Vanilla Cookies = 7
Mint Cookies = 4
etc...

Thanks for any help!

RESOLVED: Do All Enabled "Timers" Stop When Form.Unload Or Crash Is Encountered?
When my application starts, then a few Timer controls automatically start up.

1) I was wondering, when the Form.Unload method is called and the application ends normally, then do the Timer stop or must I stop them in the Unload method myself?

2) What happens if I encounter a problem in my application and the program crashes. Do I have to worry about Timers still executing in the background?







Edited by - uncletr on 1/28/2007 9:48:06 AM

Code For " [solved]
What is the "code" for the "?
I need it when generating some VB code in an app.

How Do I Stop A "for I" Loop Before Its Over? (posted In Wrong Forum First)
VB Code:
For i = 0 To antal - 1      If Text2(18 * i).BackColor = vbRed Then          Text2(18 * i + 18).BackColor = vbRed          Text2(18 * i).BackColor = vbWhite          exit for      End IfNext i


I want this loop to stop as soon as it has found a red text2 and switched colors with another text2. I want it to begin at the first text2 when there is no more textboxes. how do I do that?

Extract Local Names For "OK", "Cancel" And "Apply"
Hi!

I noticed that some programs written in C++ have an English language, but the captions of the buttons "OK", "Cancel" and "Apply" are in German, Swedish or whatever localized Windows version the user utilizes. Any idea how to obtain the captions of those buttons in VB? The only method which comes into my mind is to get the locale ID and have an array with strings for the the various language versions, but I doubt that those programs do it in that way.

Regards,
Sebastian

&lt;input Type="submit" Name="op-savefile" Value="Save"&gt; - How To S
<input type="submit" name="op-savefile" value="Save"> - How can you submit this button through visual basic in a webbrowser?

Disabling "wake Up", "sleep" && "power" Button
hello there, how to disable "wake up", "sleep" & "power" button with visual basic? thanks

CODE HELP - "Search"/"Dictionary"
This is what I am looking to do:

I am trying to create a dictionary with my own temrs and
definitions. I have created a "Definition" document that
contains a 2-column
table. First column = Word, second = Meanings/Definitions.

I am trying to create a Macro that will:
1. Ask user which word they want to look up (via an input
box);
2. Open the definition document;
3. Look up the word in the table in the definition
document;
4. If the word is not found, warn user (message box) and
and let the user start over (with the first input box)
5. If the word is found, pick up the definition in the
adjacent cell;
6. Close the definition document;
7. Display the definition (with a modeless display??)

I don't know a lot about VBA, so I have been having some
problems trying to write this code. Could someone post a
code like this or take time to help me out? If you could,
that would be GREAT.

Thanks,
Dan

What Is The VB Code For The "About" Button In MS-office "Help"
Is there anyone tell me What is the VB code for the "About" button In MS-office "Help", I mean the one in the offcie application toolbar,is that a message box or......?

Filter A Table "code = "something";"
this is my code

Data1.RecordSource = "select * from usuarios where rol = " & Form1.Text5.Text & ";"

and i get "code = something;"
and i need "code = "something";"

Please helpme!!!!!!!!

Lot of Thanks

Pleez, Read This!!! Matter Important! "Printing In "DOS Mode" Using "Shell" -not Happening, I Wonder
Hi

[I had to repost it since I have not received any replies for my earlier post]

I have a problem.

Following is the code :

Shell("c:windowscommand.com /c type " & App.path & "matrix.txt &gt;prn")

where App.path is C:XYZ

when the above line is executed, the contents of "matrix.txt" is not printed on the printer. Instead, control just passes on to the next line.

So, to find out why, I modified the line thus.

Shell("c:windowscommand.com /K")

The above command takes me to the "command prompt". Here, when I give the command "type c:xyzmatrix.txt &gt;prn", which is what the vbcode does, I get the message "file creation error".

So, I have identified the problem. Can anyone tell me why this "File creation error" occurs, And how to solve the problem?

Thanks for reading through.

Excel "File Now Available" Dialog - How To Stop It
I am using Excel in a multi-user app in VB6.
I detect that a file was opened by another user by finding that it now opens "read only" or not.
I wait till the file opens without the read-only = true.
However, some random time later, the dialog box, "File Now Available" pops up. I can't control it from VB to get rid of it.
I have set applications.displayalerts = false. No help.
Thanks.
PacBob

Stop A Webbrowser Control From "clicking"
hi guys

does anybody know if theres a way to stop the a microsoft internet control (web browser) from making that clicking sound every time it refreshes/loads a page?

alternately, is there a way to get the HTML source of a webpage WITHOUT using any extra ocx's that the user of my program may not have?

a module perhaps?

thanks!

Why Does IDE Program "stop" Button Not Work?
Good afternoon,

I've just started using VB5CCE (when I have more money, I'll buy VB6.

If I compile and run a program with F5, and an error occurs, I am shown the code window. However, at this point even though all the menus, break button, etc. all work fine, but I CANNOT press program "Stop" on the command bar. I must Ctrl-alt-del VB5 to stop the program.

Surely I am missing something fundemental here

How do I stop the program correctly?

Thanks!
Paul

How To Stop "sending Email" Warning
How can I stop Outlook from warning me that my app is sending an email using MAPI? Doesnt have to be a programatic solution ... if there is a setting I can change in Outlook that would suffice. Thanks for any help!

Stop Popup "File Not Found" Msg
When I search for files, if the file number I search for does not exist, an error message will popup saying "file not found" and it will close the application. What would be the code to stop the popup message from showing and shutting down the program, and in replacement have a message saying "File Not Found" show up as text in a list box?

Computer Wont Stop "BEEP"
I have a bunch of textboxes and lets the user press enter to jump to the next textbox in the form.
But when he hits enter the computer "beeps" as it jumps to the next textbox.

This is the code
Private Sub txtSendTo_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
frmNetSend.txtMessage.SetFocus
End If
End Sub

This is the question
Why does the computer beep and how can I force it not to?

------------------
******
on error goto bed ;0)
anders@zsystemdesign.se
*******

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