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

What Does "Invalid Property Value" Mean?

Hi everybody,I'm falling all over an "Invalid Property Value" error.What does that mean?ThanksPaul

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
"Wrong Number Of Arguments Or Invalid Property Assignment".

I'm a VB newbie. I'm getting the following error in my program at db.Execute:

"Wrong number of arguments or invalid property assignment".

Here's what I'm doing......

I have VB data entry form that is supposed to write to 2 related tables (PatientVisits and PatientConsultation) in the same Access database via a Query called VisitConsult.

In VB, when the user clicks on the Save button, I open the database and issue the following INSERT INTO command:

intFee = CInt(Fee.Text)
Dim db As Connection
Set db = New Connection
adoPrimaryRS.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51; Data Source=C:pispis-97_2.mdb;"

db.Execute "INSERT INTO VisitConsult(PatientVisits.Identity_Number,PatientVisits.VisitRefNumber," & _
"Doctor, DateofVisit,Fee_Paid,PatientConsultation.Identity_Number, PatientConsultation.VisitRefNumber," & _
"Symptoms,Diagnosis,Treatment,Referral) VALUES(patientvisitID.Text,visitRefLabel.Text," & _
"Combo2.Text,Date,intFee, patientvisitID.Text,visitRefLabel.Text,Symptoms.Text," & _
"Diagnosis.Text, Treatment.Text,ReferralBox.Text)", db, adOpenStatic, adLockOptimistic
What am I doing wrong?

Thanks in advance.

Edit by moderator: Please use [vb] tags and line breaks to format your code.

What Do I Get: "wrong Number Of Arguments Or Invalid Property Assignment"
What is wrong with this code that would give me this error:

compile error:
wrong number of arguments or invalid property assignment


Private Sub Command1_Click()
Dim rs As ADODB.Connection

Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C: est.mdb;"


rs.Open "Select Black FROM Colors;", conn, adOpenStatic, adLockOptimistic

Text1.Text = rs(0)


End Sub

"The Property 'SourceFile' Of File Blah Is Invalid" --- Visual Studio Installer
Ok, I have an EXE, which uses a DLL, which inturn uses another DLL...

UI ---> Objects ---> Server

Although ALL these components are to go on the client PC...
Now, all compiled fine, and all reference each other fone.
However, when I try and use VSI to create a setup package the SourceFile property for my server DLL is different to the others:

Other are:


BUT the server file is just simply:


Now when playing with VSI I did manage to get some error messages in the task list thing that said msado21.tlb could not be added to install. My server objects is the only tier to use ADO...could this be the cause?

I have 1hr and 56 mins to fix this problem!

I REALLY hope someone can help


Format Function Error - "Wrong Number Of Arguments Or Invalid Property Assignment"

I have searched google and this board but am unable to solve this issue. I am getting this error on the ".FrameProgress.Caption" line. Why am I getting this error? I have other procedures using Format and it works while I am getting this error on other Format functions.

This is VBA in excel XP

Sub UpdatePBar(pctDone As Single, Optional Cap As String)

With pBar

If Cap <> "" Then
.lbStatus = Cap
End If

.FrameProgress.Caption = Format(pctDone, "0%")
.LabelProgress.Width = pctDone * (.FrameProgress.Width - 10)
End With
' The DoEvents allows the userform to update
End Sub


Help! "Wrong # Of Arguments Or Invalid Property Assignment"??????
Have recorded alot of macros in an excel file - many of which require the selection of a range of values in the execution of the commands...any macro or sub with a range("cell1;...celln").select syntax in it seems to be burping at this point - any ideas as to why? I'm desperate - have a deadline I'm up against and my file's far from working...thanks in advance...roni72

Why Is This Giving Me An "Invalid Property Value" Error? [SOLVED]
VB Code:
Private Sub cmdPlay_Click()    MediaPlayer1.Volume = 0    MediaPlayer1.Open Path & "" & tvwSongs.SelectedItem    ProgressBar1.Max = MediaPlayer1.Duration    Timer1.Enabled = TrueEnd Sub

I tried using the Round function to round it off, but it still gives that error.

The Error Shows: "Invalid Property Value"

Why I am getting "invalid property value" while executing the following code? Please help me out. The code in bold was highlighted.

VB Code:
Public Sub cmdGetTotalCollections_Click() Dim i As Integer, CTotal As Double For i = 1 To lvwCollections.ListItems.Count [b]CTotal = CTotal + lvwCollections.ListItems.Item(i).SubItems(3)[/b]     Next i txtGetTotalCollections.Text = CTotaltxtGetTotalCollections.Text = Format(txtGetTotalCollections.Text, "##,##.00")End Sub


Listview Error "invalid Property Value" --
Ok another (simple) problem. The following code is giving me an error: "invalid property value".

What's wrong??

Thanks for your help...

- Jake

Private Sub SelectFixable_BTN_Click()
Dim sf_1 As Integer
MsgBox ("trying to select fixable")

If ListView1.ListItems.Count = 0 Then Exit Sub
For sf_1 = ListView1.ListItems.Count To 1 Step -1
MsgBox (ListView1.ListItems(sf_1).SubItems(10))
If ListView1.ListItems(sf_1).SubItems(10) = "Yes" Then
ListView1.ListItems.Item(sf_1).Selected = True
End If
Next sf_1

MsgBox ("Finished attempt to select fixable")
ListView1.HideSelection = False

End Sub

A Runtime Error "Invalid Property"

i try and run my app that relates to an access database through ADO and i get a message stating

Run-time error '380':

Invalid property value

The error occurs at " dtpStartDate.Value = rs.Fields("StartDate") " this is a datepicker

This is the whole Sub

Public Sub fillfields()
If Not (rs.BOF = True Or rs.EOF = True) Then 'Checks if we are at the first or last record. This is use a lot.
lblItemNumber.Caption = rs.Fields("ItemNumber")
lblHighestBidder.Caption = rs.Fields("HighestBidder")
dtpStartDate.Value = rs.Fields("StartDate")
dtpEndDate.Value = rs.Fields("EndDate")
txtFinalPrice.Text = rs.Fields("FinalPrice")
txtPostage.Text = rs.Fields("Postage")
txtPackaging.Text = rs.Fields("Packaging")
lblTotal.Caption = rs.Fields("Total")
txtExtraAmount.Text = rs.Fields("ExtraAmount")
rtbReason.Text = rs.Fields("Reason")
dtpReceivedMoneyDate.Value = rs.Fields("ReceivedMoneyDate")
lblReceivedMoneyType.Caption = rs.Fields("ReceivedMoneyType")
dtpSentItemDate.Value = rs.Fields("SentItemDate")
dtpReceivedItemDate.Value = rs.Fields("ReceivedItemDate")

MsgBox "Either you are at the first record or the last record.", vbExclamation, "Cannot Move"
End If
End Sub

Does anyone know what the problem could be???


Data Base "Invalid Property Value"
I am using vb6, sp5 and jet engine (DAO).  The app works fine on the development machine but when installed on a client computer I get Error 380,"Invalid Property Value" at the point at which it is accessing a NULL field.  It even happens if I use IF ISNULL(DB!FIELD) THEN...

It seems that I might be missing a program component.  

Any suggestions would be welcome.

Thanks,     David Abineri


"Invalid Use Of Property" With An Object....
VB Code:
set TempCust = New clsCustomerset TempCust.FirstName = txtFirstName.Text

for some reason this is giving me an error.... i thought i had classes sorted but evidently not...

TempCust is dim-ed in a module to make it global, it needs to be accessed between forms

all the properties of clsCustomer are public (yeah, its bad, so bite me)

whats wrong?

Message "Invalid Property Value"
The problem is that I don't know how to "restart" the ComboBox object:

1. I added values to it.
2. At the beginning the value (text that it shows) is empty.
3. I chose some value
4. Now I'd like to make again empty:
for example, I write something like this:

ComboBox1.ListIndex = -1
ComboBox1.Value = ""
'and here I am adding the values again

But the problem is that when I want to choose another object in the form I cannot because of the error message:

Invalid property value


""The Given Assembly Name Or Codebase, 'Microsoft.WindowsCE.Forms', Was Invalid.""
Has anyone seen this error or Know what to do with it?
I have the program almost finished.When I deploy it to my pocket pc, everything is fine but when i try to install from the exe that I compiled it has this error.
then goes into debugging mode.
""The given assembly name or codebase, 'Microsoft.WindowsCE.Forms', was invalid

Edited by - Fredd on 11/17/2003 4:54:01 PM

"Type Mismatch"/"Invalid Qualifier" Error
Hi all

Am just using VB6 for the first time. Am connecting to a SQL Server 2000 database. What i am trying to do is simple select a single cell from the database into a string variable and then hold onto that variable for as long as i need it. The problem is that when i go to put the value into the variable i get a "Type Mismatch" error or an "Invalid Qualifier" error

The global variable that i am using:
Dim conn as new ADODB.Connection
Dim cmd as new ADODB.Command
Dim tempString as String

The connection string that i am using is: "UID=;pwd=;Database=Marts;" & _
"Server=localhost;Driver={SQL Server};

The statement that i am executing is:
cmd.ActiveConnection = conn
cmd.commandType = adCmdText
cmd.commandText = "Select ColumnA from TableA where ColumnB = 'ABC'"
tempString = cmd.Execute

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

Changing The "value" Property Causes A "click" Event
Is there any way to make it so that when I change the "Value" property of a textBox or CheckBox or whatever, it doesn't fire a "Click" event? I'm having problems because when I change it, it then tries to do an update, thinking the user clicked it.

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

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?


ADO Recordset's Filter Property(Usage Of "Is Null" And "Is Not Null")
Hi, Gurus!

IS NOT NULL and IS NULL aren't in the list of allowed operators for the Filter property.
Is it ok to use LIKE '%' instead of IS NOT NULL and what can we use instead of IS NULL?

<Edit> Removed previous question, which was wrong. </Edit>

Making mistakes is one of the ways of improvement.
GL and HF

Edited by - un5killed on 3/26/2007 2:22:19 AM

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

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.

Correctly Save Image To Solve "Invalid Picture" Problem
Hello everybody,

I'm having trouble in a system I'm working on. I receive some images from a customer in a different format (SGD extension, created by the customer). I want to load this image in a PictureBox to resize them, but I get a "Invalid Picture" error. I've tested and checked that if I enter Ms Paint and re-save the image as JPG (instead of renaming it, as I was doing) the error will not occur. So, what I need to do is resave it programatically.

Does anybody know how to do it?


Correctly Save Image To Solve "Invalid Picture" Problem
Hello everybody,

I'm having trouble in a system I'm working on. I receive some images from a customer in a different format (SGD extension, created by the customer). I want to load this image in a PictureBox to resize them, but I get a "Invalid Picture" error. I've tested and checked that if I enter Ms Paint and re-save the image as JPG (instead of renaming it, as I was doing) the error will not occur. So, what I need to do is resave it programatically.

Does anybody know how to do it?


"Invalid Qualifier" Error When Passing String Param To Function
-Compile Error: Invalid Qualifier

Hi All
I have written a simple function to populate various combo boxes in my application. The comboboxes are on various seperate forms so i decided to create the function as a public function and i wrote it in a global.bas module (not sure if this was the right thing to do so let me know if you think this should be changed)

Anyway the main problem is that when I pass the combobox_name to the function e.g. "Form1.cboBranchName" i get the invalid qualifier error

For info the sStoredProcName string parameter seems to pass without problem

P.s. My Vb knoweldge is very rusty and isnt great to begin with so please can you break it down a simply as u can, and feel free to point out any other glaring errors


The called function
Public Function PopulateComboBoxes(sStoredProcName As String, sComboBox As String, intCol As Integer, bNotSpecified As Boolean)

Dim sqlcon3 As New adodb.Connection
Dim Rs3 As New adodb.Recordset
Dim temp1 As Variant
Dim sqlstr As String
Dim i As Integer

sqlcon3.Open "Provider=sqloledb;data source=szs005;initial catalog=CallLog;", "shoezone", "property"

With Rs3
    .CursorType = adOpenDynamic
    .CursorLocation = adUseClient
    .LockType = adLockOptimistic
End With

Set Rs3 = sqlcon3.Execute(sStoredProcName)

Do While Not Rs3.EOF
    sComboBox.AddItem Rs3.Fields(intCol).Value
    sComboBox.ItemData(sComboBox.NewIndex) = Rs3.Fields _(intCol).Value

sComboBox.Text = sComboBox.List(0)

End Function

The Calling function
Private Sub PopulateFilterBys()

'Get Branch List
Call PopulateComboBoxes("Exec branch", "Form1.cboBranch", 0, True)

End Sub

CDOSYS CreateMHTMLBody Returns Error "Invalid Syntax"

I have been using CDOSYS, on windows 2003 server having office 2003 installed.
CreateMHTMLBody of CDO.message is failing for some urls like "" & "" while working just fine for others.

Any help is really appreciated on this issue.

CreateMHTMLBody returns "Invalid syntax" with error no. "-2147221020 ".

Thanks in advance.

Why This "35610 Invalid Object" Violation In Highlighted Line
Hi everybody,

The following code ought to fill a TreeView with Parent, Child and GrandChild nodes but fails (on the highlighted line) with a "Run Time Error 35610". Other than refering to an Invalid Object there isn't a suggestion about which object is being offended, or why.

Can someone help me?

Private Sub FillExpenseTree()
tvExpenses.Nodes.Add , , "Expense", "Expense"
tvExpenses.Nodes(1).Bold = True
tvExpenses.Nodes(1).Expanded = True
tvExpenses.Nodes(1).ForeColor = vbBlue
sSql = "SELECT acct_title, acct_title_id FROM tbl_acct_title WHERE acct_head_id = 2 ;"
Set rsData1 = New ADODB.Recordset
Set rsData1 = cnDB.Execute(sSql)
While rsData1.EOF = False
tvExpenses.Nodes.Add "Expense", tvwChild, , rsData1.Fields(1) & ".." & rsData1.Fields(0)
sSql = "SELECT * FROM tbl_acct_list WHERE acct_head_id =2 ;"
Set rsData2 = New ADODB.Recordset
Set rsData2 = cnDB.Execute(sSql)
Do While Not rsData1.EOF
While rsData2.EOF = False
tvExpenses.Nodes.Add rsData1!Acct_title, tvwChild, rsData2!acct_list, rsData2!acct_list
End Sub



Can't Make Listview Item In Bold As "Invalid Key" Error
I have a list of items in Listview. How to take an action if I double click an item in that Listview. For eg, I want an another form to load when I click a particular item? Thanks.

CDOSYS CreateMHTMLBody Returns Error "Invalid Syntax"

I have been using CDOSYS, on windows 2003 server having office 2003 installed.
CreateMHTMLBody of CDO.message is failing for some urls like "" & "" while working just fine for others.

Any help is really appreciated on this issue.

CreateMHTMLBody returns "Invalid syntax" with error no. "-2147221020 ".

Thanks in advance.

HELP! "Win32Api Caused And Invalid Page Fault In Kernel32.dll..."
Ok. Here's my problem. If I have my computer on for about half a day, it starts to freeze for very short periods of time randomly. My clock in the corner starts getting behind (Right now it's 1:54, and the clock on the screen says 1:33)

I'm running win 98.

Ok, here's the main problem. After a while, this box pops up titled "Win32api" and says "This program has performed an illegal operation...blah blah blah..." This box stays on top over any window I have open, so I have to move it down to a corner to continue working. If I close it, my system freezes and I have to shut it down manually and wait for teh scan disk thing on start up and all that crap.

Here's what the details show on the error box:

WIN32API caused an invalid page fault in
module KERNEL32.DLL at 0167:bff7a4b2.
EAX=00000000 CS=0167 EIP=bff7a4b2 EFLGS=00010206
EBX=00000000 SS=016f ESP=0064f2e4 EBP=0064f2f4
ECX=00420018 DS=016f ESI=00420000 FS=241f
EDX=0000007c ES=016f EDI=0042000c GS=0000
Bytes at CS:EIP:
8b 03 25 fc ff ff 0f 3b 45 0c 0f 83 81 00 00 00
Stack dump:
00000078 bff76ec4 0000000b 0064f424 0064f308 bff88dc4 00420000 0000007c 00000000 00000000 7fc0b9af 00420000 00000000 00000078 0041001c ffffffff

Some of that at the bottom looks like color coding for HTML, but I can't imagine my browser (IE 5) causing this.

Any help would be greatly appreciated.


Data Report Error "Closed Or Invalid Connection"
I am using the Data environment with the Data Report.

My reports run fine the first time, but if the user attempts to run them again, I get the error "Operation is not allowed on an object referencing a closed or invalid connection."

I don't completely understand the correct way to open, close or set the connection the the data environement, or the reports. Here is my code, which works once, but I need to be able to run the reports multiple times. Thanks in advance for any help.

The error occurs when trying to open the rscomHourlyRpt


DtaReports.CnnReports.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=pdp.mdb;Persist Security Info=false"

If DtaReports.CnnReports.State = 0 then
MsgBox "Reports failed to initialize. Please try again."
Exit Sub
End If
on error resume next
on error GoTo 0

fraPrinting(0).Visible = true

''''Hourly Employee Report
SQL$ = ""
SQL$ = SQL$ & "VAL(RegHrs) * .01 as RegHrs,"
SQL$ = SQL$ & "VAL(OvtHrs) * .01 as OvtHrs,"
SQL$ = SQL$ & "VAL(dblHrs) * .01 as DblHrs,"
SQL$ = SQL$ & "VAL(reg2Hrs) * .01 as Reg2Hrs,"
SQL$ = SQL$ & "VAL(Reg3Hrs) * .01 as Reg3Hrs,"
SQL$ = SQL$ & "VAL(Ovt2Hrs) * .01 as Ovt2Hrs,"
SQL$ = SQL$ & "VAL(Ovt3Hrs) * .01 as Ovt3Hrs,"
SQL$ = SQL$ & "VAL(Oth1Ern) * .01 as Oth1Ern,"
SQL$ = SQL$ & "VAL(SickHrs) * .01 as SickHrs,"
SQL$ = SQL$ & "VAL(VacHrs) * .01 as VacHrs,"
SQL$ = SQL$ & "VAL(HolHrs) * .01 as HolHrs,"
SQL$ = SQL$ & "VAL(CommErn) * .01 as CommErn,"
SQL$ = SQL$ & "VAL(Meals) * .01 as Meals,"
SQL$ = SQL$ & "VAL(Tips) * .01 as Tips,"
SQL$ = SQL$ & "VAL(MiscHrs) * .01 as MiscHrs,"
SQL$ = SQL$ & "VAL(Oth2Ern) * .01 as Oth2Ern,"
SQL$ = SQL$ & "VAL(AdjToNet) * .01 as Adj,"
SQL$ = SQL$ & "Cdiv,cDept FROM Query2 "

If PR.PAGEORDER = 5 And ManPage% = 0 then
frmBalanceMenu.KeyPreview = false
fraPaging(0).Visible = true
txtPaging.Text = ""
Exit Sub
End If

If PR.PAGEORDER = 1 Or ManPage% = 1 then
GoTo Choose
End If
If PR.PAGEORDER = 2 Or ManPage% = 2 then
GoTo Choose
End If
If PR.PAGEORDER = 3 Or ManPage% = 3 then
Debug.print SQL$

GoTo Choose
End If
If PR.PAGEORDER = 4 Or ManPage% = 4 then
SQL$ = SQL$ & "ORDER BY cDiv,cDept,LName, FSTName ASC"
GoTo Choose
End If
MsgBox "Paging Order error. set Paging order in Param File"
Exit Sub

on error resume next
on error GoTo 0

DtaReports.rscomHourlyRpt.Open SQL$ ''error occurs
RptHourly.Orientation = rptOrientLandscape

Changing Printers With Rundll32 - Error "Invalid Arguments"
Hello. I'm looking to:
Save the existing printer info into a file.
change the printer to a printer name passed into the system(PrinterDevName)
Finally change the printer back to the original printer utilizing the previously saved file.

The code to do this is below:


oldPrinter = Printer.DeviceName

Shell "rundll32 printui.dll,PrintUIEntry /Ss /n" & oldPrinter & "/a file.dat"

Shell "RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n" & Chr(34) & PrinterDevName & Chr(34)

Shell "rundll32 printui.dll,PrintUIEntry /Sr /n" & oldPrinter & Chr(34) & "/a file.dat"

The first and third shell call (to save the printer data to a file and then to use the printer data saved to the file) are returning "Invalid Argument" errors. Do you know why? What's wrong with the syntax?

Thank you!

Adding Dollar Sign In A Script Control Causes The Error "invalid Character"?
I need for the output of a script to have a dollar sign.... But the Script Control says that its an invalid character..
How can this be avoied?

"Invalid Field Data Type." When Converting To Prior Version Of MS Access.
I'm developing a website that uses a MS Access database. I'm creating the database in Access 2000, but the web server can only open Access 97 databases. I've been using the "Convert Database -> To prior Access Version" for the web server to use, and it's been working fine.

I just added a new table to the database containing the following fields:

ID - AutoNumber, Long Integer, Autoincrement, Primary Key, Not required, Indexed (No duplicates)
paragragh - Memo, Not required, Zero length allowed, Unicode Compression
picture - Text, Max 50, Not required, Zero length allowed, Not indexed, Unicode Compression
picturealignment - Text, Max 5, Not required, Zero length allowed, Not indexed, Unicode Compression
fonttags - Text, Max 100, Not required, Zero length allowed, Not indexed, Unicode Compression

Now when I try to convert it to an Access 97 database I get a

"Invalid field data type."

first, followed by

"Some errors happened during the conversion. No converted database is generated."

Can anyone help me?

"Invalid Operation" Setting Field Attributes

I receive error "Invalid Operation" while trying to change the Attributes property of a field in DAO 3.6.

I don't think I have to post the code, because I just wrote a small dummy program with six lines or so to open the database, open the table, and set the attribute of a field. I received this same error. First I tried with TableDef object, then with Recordset, but to no avail.

Just in case it matters, I am trying to set field Attributes to 1 + dbAutoIncrField, which equals 17.

The XML from which I set the property is as follows (I am writing a part of program that will allow to restore/update the database from its saved XML definition):

<property name="Attributes" type="dbLong">17</property>
This is also automatically generated by my program, so it is truthful.

"runtime Error 6149 Invalid Bookmark"
Software environment :
VB6.0 SP6, sql server2000, XP SP3. I have used components like datagrid..,crystal reports

"runtime error 6149 invalid bookmark". This is the error i get from the vb application.
Does anyhow know the reason or causes for the runtime error .?

can anyone suggest whats the possibility of this error?? and how to correct the error.
thanks in advance
Siraj [Email address removed by mod]

Search Error "Invalid Pattern String"
Below is my code to search my database. I am wondering why is it that when i type this "[" as the first character in my textbox, the error is invalid pattern string but if the "[" is located anywhere in my text as long as it is not the first character then there is no error. What seems to be missing in my code? Any help please....
Example: When i type.
t[esting there's no error

Private Sub txtSearch_Change()
Dim rsStocks1 As New ADODB.Recordset
sSQL = doQuery(txtSearch.Text, "ProductDescription")
rsStocks1.Open sSQL, oConn, adOpenForwardOnly, adLockOptimistic

If rsStocks1.EOF = False Then
Call FillListView(lstProdLookUp, rsStocks1)
End If
End Sub

Function doQuery(ByVal sCriteria As String, ByVal sfieldName As String) As String
If InStr(sCriteria, "'") <> 0 Then
sCriteria = Replace(sCriteria, "'", "''")
End If
doQuery = "SELECT Code, ProductDescription,PurchasePrice,Quantity, " & _
"Unit,EntryDate, ReOrder FROM tblStocks " & _
"WHERE " & sfieldName & " LIKE '" & sCriteria & "%'"
End Function

"Invalid File Format" On A Label During Debugging

In some old project I'm working on there is a wierd problem. When debugging, it crashes on the following line:

lblLayout.Caption = "1 X 1"

with error -321 (Invalid File Format). lblLayout is a simple innocent label.

The project exe runs just fine outside of the VB environment.

I thought the frm or frx files might be corrupted but they seem to be OK. I have no problems opening the form and modifying it.

Any idea what could be causing this ?

RichTextBox RtfRTF Says "Invalid File Format"
I'm trying to load either a .doc or a.rtf into a RichTextBox.

Anytime I use rtfRTF instaed of rtfText, I get an "Invalid file format" error. Many examples in this forum use rtfRtf.

RichTextBox1.LoadFile App.Path & "hpac.rtf", rtfRTF

What I'm trying to do is to load a .doc, copy the text (without the formatting crap) to the clipboard, then use just the text info.

I'm on WinXP (SP1), VB6 SP5.

Any suggestions would be appreciated.

"invalid Use Of Null" Error. Makes No Sense
If rstTable.Fields(2) = Null Then
strDescription = " "
strDescription = rstTable.Fields(2)
'"Invalid use of null" error occurs right here. How can this be?
End If

"Invalid Procedure Call Or Argument" When Using Replace
When I try and use the Replace function inside Access 2000, sometimes it doesn't work, giving that error.

It's totally random whether it works or not, and it's not because of anything in the session because it doesn't always work straight after a restart.

It's really annoying me because if I need it it means I have to restart and get everything loaded up again.

The code is definitely right, because it works! It's just that the Replace function messes up...

...anyone got any bright ideas?

ActiveX DLL-"Invalid Procedure Call Or Argument"
hi,anybody can help?

I developing COM DLL, & before I make the .dll files, the program runs just fine.But after I compile & make .dll files,
there is an error when I tried to click on "Save button" for one of the add record function.
error pops up!"Invalid procedure call or argument", followed by "Automation error". After I click OK,the whole form is no more respond to mouse click except the x button on right top side(to close the form)

under the "cmdSave_Click", I call functions from the class.


Error "invalid Procedure Call Or Argument"
what wrong for my code? when i open the "SampleExtract.txt", it work well. But, when i open the "Output.txt". it came out an error "invalid procedure call or argument"

i have attach the code and the two text file. Can somebody help me to find out the problem. thanks.

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

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.


&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

"invalid Procedure Call Or Argument"
i need urgent help now i wish to talk on an im,yahoo or gmail
i have a project to complete by tommorrow
i have an error as my problem "invalid procedure call or argument"
please tell me what is wrong with this fn"

Public Function pow(x As Variant, Y As Variant) As Double
pow = Round(Exp(Y * Log(x)), 5)
End Function

Errors - "5" Invalid Call Or Procedure
when it runs this code people get this error.. When I run it I don't so I'm wondering why.


Option Explicit
Public stopp As Boolean
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex _
As Long, ByVal dwNewLong As Long) As Long
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, _
ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByRef lpBuffer As Any, ByVal nSize As Long,_
lpNumberOfBytesRead As Long) As Long
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function GetAsyncKeyState Lib "user32" _

[code that causes the error]

Private Sub Form_Load()
Dim lmirHwnd As Long
lmirHwnd = FindWindow(vbNullString, "Nicks test")
lStyle = GetWindowLong(Form1.hwnd, GWL_STYLE)
lStyle = lStyle Or WS_CHILD Or WS_POPUP

If lmirHwnd Then
' Call SetWindowLong(Form1.hwnd, GWL_STYLE, lStyle)
Call SetParent(Form1.hwnd, lmirHwnd)
Call SetWindowLong(Form1.hwnd, GWL_HWNDPARENT, lmirHwnd)
'MakeTransparent1 frmMain
Exit Sub
End If
Dim string2 As String
Dim hm() As String
Open App.Path & "" & "friends.txt" For Binary As #1
string2 = Space(LOF(1))
Get #1, , string2
hm = Split(string2, "+")
For i = 0 To UBound(hm)
List2.AddItem hm(i) & "+"
Close #1
Dim lastitem As Long
lastitem = List2.ListCount - 1
List2.RemoveItem (lastitem)
friends.Caption = List2.ListCount
string2 = ""
End Sub


"Invalid Procedure Call Or Argument"
In my following code following error is displayed at line 3. What's Wrong ?

Run-time error '5':

Invalid procedure call or argument

1 Dim myap2
2 myap2 = Shell("d:sunjavajsdk14injavaw.exe -classpath d:sunjava jsdk14jrelib
t.jar; display", vbMaximizedFocus)
3 AppActivate myap2

Copyright Đ 2005-08, All rights reserved