Error 3001

danny123

Registered User.
Local time
Today, 04:43
Joined
Jul 21, 2006
Messages
100
hi there,

when i am searching one of the table in access db i am getting below error

"Run Time error 3001" Invalid Argument.

It was just working fine 1 min ago.

Thanks
Danny
 
i am searching it through the form.

and when i click on the debug it take me to this code..


Function GetFieldType(sField As String, sTable As String) As String
Dim dbpeta As Database
Dim rsTable As Recordset
Dim iType As Integer

Set dbpeta = CurrentDb
Set rsTable = dbpeta.OpenRecordset(sTable, dbOpenTable)
iType = rsTable.Fields(sField).TYPE

Select Case iType
Case dbMemo, dbText, dbChar
GetFieldType = "Text"
Case dbDate
GetFieldType = "Date"
Case Else
GetFieldType = "Number"
End Select


End Function


open table statement is the one where it is getting stuck
 
Are you sure that your sTable string is getting a value? When you break for that error what does the immediate window show is in that string?
 
how can i check that thing? I am really new to vb

Thaks alot for support!!!
 
When your code errors out and you click DEBUG and then it puts the yellow line where the error occured, before clicking the stop button to go out of break mode, you can mouse over your code where you see the word sTable and it should show you in a pop up tool tip.

If you can't see that, then while it is still in Break mode, if a window that says IMMEDIATE WINDOW is not showing, go to VIEW > IMMEDIATE WINDOW and then in that window type a question mark and the string name and hit your Enter key like this:

? sTable

Then it should show you the value in that window, if there is one. If not it will be blank or say null.
 

Users who are viewing this thread

Back
Top Bottom