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




How To Compare Recordset With String?


hi,

How to compare a recordset data with a string? I have something like this which doesn't work

If Adodc.Recordset!ColumnName = "String" Then
.....

I have a for loop before this statement to compare one record at a time.

I am trying to select only the record in this database which have data in "ColumnName" equal to the string I compare with.

Please help, thanks in advance.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Compare Recordset With String?
hi,

I am having this problem, I try to compare recordset with a string something like this...

if Adodc1.recordset!Name = "string" then
.....

this doesn't work Please help me.

thanks in advance.

How To Compare Recordset With String?
hi,

How to compare a recordset data with a string? I have something like this which doesn't work

If Adodc.Recordset!ColumnName = "String" Then
.....

I am trying to select only the record in this database which have data in "ColumnName" equal to the string I compare with.

Please help, thanks in advance.

ps. I'm pretty new here but this forum is the best

Compare Recordset Field Value
Hi, this is my second post. Hope someone can give me an idea on how to do it.

I want to compare the first value with the next value until EOF.
See for example if I have this first field value of S0001N10_XX_2 (field value has 10 char)
- Compare this value with the second value, third, fourth until EOF and then it loop incrementing its row.

By the way I am using Access97 DB.



Edited by - cglccb on 3/2/2005 6:02:25 PM

Compare Values In Recordset For If Statement
I have a query that returns 4 records
The field I want to compare is decimal value (Double)
First of all I want to compare the 3rd record and 4th record value to see if they are equal.
Do a If ..Then..Else
Secondly I now want to compare 2nd and 3rd recordset values to see if they are equal.
Do a If ..Then..Else

As a simple test, I have tried dim and let statements
the let statement will not allow me to = the queryname fieldname.
Is it the syntax of the query or are you not allowed to assign a variable from a query
CODEPrivate Sub Set_the_variable()
    Dim i1 As Double
    Dim i2 As Double
    Let i1 = 1
    Let i2 = qry.[ian2]![IssueID]
    MsgBox "i1 = " & i1
    MsgBox "i2 = " & i2
        If i1 = i2 Then
            MsgBox "i1 & i2 are = "
        Else
            MsgBox "i1 & i2 are NOT = "
        End If
End Sub

[Unresolve]-Compare Field Value In A Recordset And Loop Until It Meet The Criteria Set.
Suppose I have 22 fields in a recordset. What i want is select a certain field value in a recordset, and after I select a value of the field, the program will have to move to the next field value and compare its value to the first field value with the second value. How will I do this?.

Suppose I have the value of the recordset field "DOCUMENT"

1. First field value ---> objrst.fields("DOCUMENT") = ABCD1234_2
2. Second field value ---> objrst.fields("DOCUMENT") = ABCD1234_3
... then first field valued will be compared again with the next field value until such it will reach EOF
... then read the second field valued then same process until EOF.

How will I do this? appreciate your help.

Thank you.

Here's a VBA code from Excel... How will i translate this code to VB?

'==============================================
Function Criteria_2(q As QueryFile, ByVal iRow As String) As Boolean
On Error GoTo Criteria2_Error
Dim sFindItem As String
Dim sRev As String
Dim sRev1 As String
Dim sNewString As String
Dim iNewLength As Integer
Dim iStartPos As Integer
    
    Criteria_2 = True
    
    If UserForm1.chkBSRev.Value = False Or q.R_Document = "" Then
        Exit Function
    End If

    UserForm1.lblStatus.Caption = q.R_Document
    
    iNewLength = Len(q.R_Document) - InStr(1, q.R_Document, "_")
    sNewString = Mid(q.R_Document, InStr(1, q.R_Document, "_") + 1, iNewLength)
    sRev = Mid(sNewString, 4)
    If IsNumeric(sRev) Then
        sRev = sRev + 1
    Else
        sRev = Chr(Asc(sRev) + 1)
    End If
    sFindItem = Mid(q.R_Document, 1, InStr(1, q.R_Document, "_")) & "XX_" & "*"
    
    Cells(iRow, 18).Select
    Cells.Find(What:=sFindItem, After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False).Activate
    
    Do
        If Not ActiveCell.Value = "" Then
            iNewLength = Len(ActiveCell.Value) - InStr(1, ActiveCell.Value, "_")
            sNewString = Mid(ActiveCell.Value, InStr(1, ActiveCell.Value, "_") + 1, iNewLength)
            sRev1 = Mid(sNewString, 4)
        End If
        
        If ActiveCell.Row <= iRow Then
            Exit Do
        End If
        
        If CInt(sRev1) > CInt(sRev) Then
            Criteria_2 = False
            Exit Function
        End If
        
        Cells.FindNext(After:=ActiveCell).Activate
    Loop
Criteria2_Error:
End Function
'==============================================



Edited by - cglccb on 3/2/2005 6:01:48 PM

String Compare
I am new in VB, I have VB 6.0, I want to read data from text file and then want to process that data, and then want to save that data in new file. How can I read one word from file? GET command read whole line from file. 2ndly, how can I compare whole line with any charachter, for example

Line is " this is VB forum"
and I wasnt to remove all white space and want to save all data in following format in new file
This
is
vb
forum

In C++ I know I can read the whole line in array and than I can compare each element with white space (if(data[count] == " ") ....) how can I do that in VB. And how can I use strncpy("data", " mydata")... and strcpy() in VB.

Please perdon me for these basic questions. I read books but didn't get string compare function.

Thanks

Syed

Compare String
Hi,

I am using this function "Instr" to find the position of the first occurrence of one string within another. I have a text file that look like this:

ABCThis is an apple <-- I want to find this string 1
DEFEThis is a dog
GHQ123This is goodABC <-- I don't want this string 3
BGHThis is a book


Let say I want to search for the 1st string pattern "ABC" in the textfile, so I have this command:

If InStr(rdLine, "ABC") then tmpVar=rdline

but everytime the file is read, tmpVar is always assign with String 3 rather than String 1.

Is is possible for me to check this string pattern "ABC" where there is NO characters infront of "ABC" so that String 1 will return.

Those labels (ABC, DEFE, GHQ123, BHG) have variable length rather than fixed length.

Thanks in advance.

String Compare Help
Im not quite sure where to start
Im writing a time sheet program there are 7 pay roll codes

H , JS, AH, SL , AH, BL, ACC

But the only apply to some employees

eg. someone on salary can only have H , ACC
where as a waged employee can have PH, SL , AH, BL

what i need to do is some how set up some rules

pseduo code

salarypaycodes = "H" , "ACC"
wagepaycodes = "PH", "SL" , "AH", "BL"


select paytype
case salary
if code entered in salarypaycodes then
do stuff
else
show error mesage
end if
case wage
if code entered in wagepaycodes then
do stuff
else
show error mesage
end if

end select

String Compare...
Hi again. Does anybody know how can i compaire strings? let's say i have "hello" and i want it to be compaired with another string and return true (if that was "hello") or false (if that was anything else). (i am actually asking for something like strcmp and strstr in c). how can i do that? also how can i get a result from the open function inicating if opening the file was succesful or not? if you can answer in any of the above question i would be realy happy! thanks anyway...

Compare String
I need to build a complex comparison string.
Starting with a simple one here I am just trying to compare if (1=1).
Is this possible to do with a string?
I am getting a type mismatch with this code


Code:
Dim a, b As Integer
a = 1
b = 1
Dim mystr As String
mystr = "(" & a & " = " & b & ")"
If mystr Then
'run some code
End If

String Compare
I got a problem with string comparison. I got two dates with the string format (i.e. "03/07/07" and "03/07/10") and I try to compare them. It was working nicely not so long ago but I had to make a few changes in my code and now it doesn't works. I think the problem may be some kind of weirdo blank characters placed after the end of my string (It seems unprobable but that's the only thing I can see). I post a screenshot of the content of my string and the spaces that follows. The string with the spaces at the end is always seen as smaller than the other one even when it isn't.... Help please !!!

String Compare
Hi
I have an array of string,I want to know which elements begin with "test"

How can i do it?
thanks

String Compare
Dear All,
Can some one give example for string compare using Like Operator?

String Compare - Reg
hi all

i want to know how we can find the difference between

two strings

help is appritiated

regards
kamesharun

Compare String
Hi,

I am using this function "Instr" to find the position of the first occurrence of one string within another. I have a text file that look like this:

ABCThis is an apple <-- I want to find this string 1
DEFEThis is a dog
GHQ123This is goodABC <-- I don't want this string 3
BGHThis is a book


Let say I want to search for the 1st string pattern "ABC" in the textfile, so I have this command:

If InStr(rdLine, "ABC") then tmpVar=rdline

but everytime the file is read, tmpVar is always assign with String 3 rather than String 1.

Is is possible for me to check this string pattern "ABC" where there is NO characters infront
of "ABC" so that String 1 will return.

Those labels (ABC, DEFE, GHQ123, BHG) have variable length rather than fixed length.

Thanks in advance.

String Compare
I have two strings to compare ,though they looks the same , the return boolean is false....

lstrString = (xlsheet.Cells(2, 1).Value) ' retrieve from excel which is empty
lstrString1 = ""
MsgBox IsNull(lstrString = lstrString1)

What happen?

Regards
Goh

How To Compare One String To.....HELP!!
Hello,
I'm trying to compare 2 strings(username, and password) to a textfie that I have loaded into my app, via richtextbox.
If there is a way to compare it without using the richtextbox that is cool. I have a textfile that has the usernames and accounts of my users in it. I get the user name and pass from the client they are using(winsock)..then I want to check if the username and password exists in my textfile. I thought I had this down, but it's not comparing right. Anyone know how to do this??? Thanks.

(eVB) How To Specified A String To Compare???
Hi everyone,
Example i got this string "ABCDEFG"
But i only want to compare position 3 to position 5 and that is the character "CDE" with what the user going to key in.

Anyone know how to extract just the position 3 to position 5 character to be compare??

Your help is greatly appreciated.
thanks

String Compare
Dear All,
Can some one give example for string compare using Like Operator?

Compare String To File
hi, this is a complicated one but i hope its possible.

what im doing is opening a file, loading so much of it into the ram (using get) then adding it to the end of another file (using put). then it repeats again so i get one file that contains a lot of other files.

now for the hard part. is there a way that i can compare the file being added and the current file with other files inside it and if theres a section of the 2 files thats longer than X amount of chars then put the positions into variables.

is that possible and will it be fast enough? the big file could be anything upto 1GB total. i dont want to wait more than a few mins for the whole thing to finish

Compare String Algorithm
Hello,

I am trying to compare two sets of strings and return a result in a percentage value for how similar the two strings are.
I realise this is a complicated function (well not a very easy one anyway), since there are many factors to analysing a percentage, like the number of words in each string, capitals and such, but still i am sure there should be some kind of function that does that.

if anyone can help me that would be great (and i'm sure there's some college student that required to do that in uni).

thanks,

Dor

Find String.... Compare It
OK...
I have a rich text box reading in a dat file.

I have a variable with the line i know is there.
I need the program to search the lines, to see if this is the same as the one i have stored.

Thanks for any help.
-Dave

String Compare Prob
hi
i started learning vb a few weeks ago and im making a prog where i need to compare two strings of numbers where the numbers are separated by a space and the strings have 7 numbers


Code:
a= " 23 2 12 5 26 21 38"
b= " 2 21 16 33 13 32 14"
'string b has 2 numbers that match string a
'so i would need the numbers that match to be displayd in a label and
'the number of numbers that match to allso be diplayd
'so i would get
label1.caption = "2" 'the number of numbers that match
label2.caption = "2 21" 'the numbers that match

ive tried a few things using instr and strcomp but i dont figure it out

String Compare In Query
Hello everyone.
i m using access db and vb6.0
i m using adodb for my conection

i want a query which will be executed in vb as
"select * from tble where 'a-a' ='a a'

that means match all strings having - and space should get matched.
i used replace function but in my code it gives an error as 'undefined finctuion replace' and the same query i executed in access, it successfully runs.
so is there any way ?

!help! Want To Compare A String With A Array
I've got another question: :-)

My prog defines the ending of a file (e.g. *.doc)

source:

EndingFile = Right(name1, 3)

my array(3) is listed with a few endings (ppt, doc, xls, txt...)

now I want to detect if the filending is contained in my array!
Who can help me? :-)

greetz

|proud to be a devil|
www.dbh-clan.de

String Compare (Resolved)
Hi, I am looking for string comparaison

I could use InStr(mystr, "x")

to search for x in the string

but, I would like something like Instr(mystr, "x" or "y")

and the function return the first one found.

Looking if that already exist before coding one myself.

Thanx all

How To Compare A Textbox As String
hi all
actually i'm working in vb6.i want to compare my textbox text as string type and long type and also date and boolean type .means i want to write like this:

if text1.text=string then
msgbox"string"
elseif text1.text=long then msgbox"long"
end if

means i want to compare with different datatypes .
plz help me .

String Compare Not Working?
Any ideas why this won't work. It runs fine without the strcomp if then condition. Thanks.

<%
cn="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("nature.mdb")
set rstitle = server.createobject("ADODB.Recordset")
sql = "nature1query"
rstitle.Open sql, cn
Response.Write("<title>Car Site - ")
titlenumber=0
num1=1
num2=20
while not rstitle.eof
titlenumber=titlenumber+1

do while titlenumber >= num1 And titlenumber <= num2

string1 = strcomp(rs("custom1"),"Auto",vbtextcompare)
If string1 = 0 Then
Response.Write (rstitle("name") & " ")
end if

titlenumber=titlenumber+1
rstitle.movenext
loop
rstitle.movenext
wend

Response.Write("</title>" & vbCr)
rstitle.Close
Set rstitle = Nothing
%>

String Compare Question...
Hi There...

My Database file has two similar values i would like to elimenate.... in the text file it goes..Quote: OEM    HG    MFG
0210001460    70-8556    
021000-1460    70-8556    

i extracted and attached my simple code below in a text file.

for having a look!

MeRRy cHriStMaSs !!



---------------------------------------------------------------------------------------------------------------------------------
Todays random quote: I am still determined to be cheerful and happy, in whatever situation I may be; for I have also learned from experience that the greater part of our happiness or misery depends upon our dispositions, and not upon our circumstances.

Martha Washington (1732 - 1802)
---------------------------------------------------------------------------------------------------------------------------------

Edited by - Hopeless on 12/23/2004 12:09:20 AM

Compare String Values
Good day,

I’ve got two string values and when I test them using IF statement I get False meaning they are not the same even though their values are the same. Can somebody please advise what might be wrong. I have a string value e.g “cat” and when I compare it with the value in the combo which is cat as well I get False as an answer. My test is as follows

 If Trim(strOldvalue) <> Trim(cboAnimalTYPE.Text) Then
               same = True
Else
             same = False
end if

Thanks in advance

Compare A String Of Dates
OK I hope I can write this to sense of this for you all.
I would like to know how someone would populate an array and then compare the dates to find out what is the first and last dates in that array.

Example of this would be
02/01/2005,02/05/2005,02/19/2005,02/15/2005

I would like to output the first and last date in that range so the output for this would be
02/01/2005 to 02/19/2005



Edited by - microcyb on 3/7/2005 1:02:32 PM

Compare Each Substring From Beginning Of String
VISUAL BASIC - STRING MANIPULATION....need help!!!!

how to search each word in a given string from a file.txt...
let say - user enter input: "my name is abc"(in textbox Text1)

search each word starting from "my" until "abc" in a given file.txt.

the output will be :
my --- saya
name --- nama
is----ialah
abc ----not found

function to search in file.txt:

FileName = App.Path & "GERMAN.txt"
Text1 = LCase(Text1)
lenn = FileLen(FileName)
Open FileName For Input As #1
allwords = Input(lenn, #1)
Close #1
wordarray = Split(allwords, vbCrLf)

M = Len(Text1)
On Error GoTo nomatch:
For index = 0 To (UBound(wordarray) + 1)
Call getword(index, word, wordarray)
germanword = LCase$(Left$(word, M))
If germanword = Text1 Then
Call getanswer(word, Text1, wordprinted)
MsgBox wordprinted ----->have to display each word
Exit Sub
End If
Next index

nomatch:
MsgBox "NO WORD FOUND": Exit Sub
End Sub

for the time being, i can only enter 1 input...but i need to enter few words (max 10 words)...is there anybody that can help me?...thanks a lot

thanks a lot

Advanced String Compare, Searching
Hi guys, I need your help, let say i want to search a file call: "Hello World.txt" in my PC. However, let say that "Hello World.txt" doesn't exit on my pc but a file "World Hello.txt" exist. So i want to make a function to find both file, the first thing i'm thinking of is to check for the lenght of the string but how to check word to word ??

Hello World.txt = World Hello.txt

Case-insensitive String Compare
Quickie - just looking for an existing function to compare example and eXamLe which will return true, without having to overload string.compare functions.

Compare String To URL Of New Web Browser Window
I'm using the VB 5 web control in my new browser. I want to kill popup windows.

I need to know how I can get the URL from a new window when it opens.

brwwebbrowser_Newwindow2 doesn't seem to have the URL varient like the other subs/functions.

When I try to declare the URL in brwwebbrowser_Newwindow2 it give an error.

What can I do?? What can I use??




Thanx

Compare Each String With Strings In Array?
I need to search an array of strings and compare each string with a given string.

I count how many characters in the string that equals the string of the array.

In the beginning the array is empty. Depending on the result of the compare the array grows. That means that the array is small in the beginning but will get big as time evolvs. Makes the application slow!

What I need to get is the "max" of the characters in the string that matches a string in the array.


Almost like this:

Code:
For i = 1 To x
count = 0
For m = 1 To 10
If Mid(string, m, 1) = Mid(Array(i), m, 1) Then
count = count + 1
End If
Next m
If count > 8 then do something...
Next i

Compare The String(which Includes Pipe)
Hi,
I am devolping project in vb6.0 & ms-asscess.

In my database i am storing values deleminted by "/". now i want to compare that values with single values.

E.g.

If in my database I ma having values 1/2
I want to compare it with 1
so it is like
1/2 =1


Plz.help me how to do this.
Project's dead line is very near.

String Compare Query [Re-opened]
Hi,

I have 2 tables both containing the same Keys. Table1 contains a sentence (along with key fields). Table2 contains a list of words. See below

Code:

Table1

Key1    Key2    Key3    Sentence
0001    0012    0235    'This query is really bugging me.'
0001    0012    0236    'This query is really bugging me today.'
0003    0013    0237    'This query is really bugging me, help.'
0003    0013    0238    'This query is really bugging me.'


Table2

Key1    Key2    Word    WordCount
0001    0012    Query    2
0001    0012    Now    2
0003    0013    Home    3
0003    0013    Bugging    3
0003    0013    This    3

 

What I need to do is determine if any of the words in the 'Word' field appear in the sentences in the 'Sentence' field. I want a list of the keys for each record in Table1 that have no words from the 'Word' Field. Below is the query I have so far. It works until I have more than one key in 'Table2', after that it just crashes.

Query:
Code:
SELECT Table1.Key1, Table1.Key2, Table1.Key3
FROM Table1 INNER JOIN Table2 ON Table2.Key1 = Table1.Key1 AND Table2.Key2 = Table1.Key2
WHERE CHARINDEX(Table2.Word, Table1.Sentence, 0) = 0
GROUP BY Table1.Key1, Table1.Key2, Table1.Key3
HAVING COUNT(Table1.Key1) =
(SELECT DISTINCT Table2.WordCount
FROM Table2 INNER JOIN Table2 ON Table2.Key1 = Table1.Key1 AND Table2.Key2 = Table1.Key2);


Guidence Needed

Cyphin
~Of all the things I've lost, I miss my mind the most.~
~Iz vseh veshei chto ya poteryal, ya bol'she vsego skuchayu po rassudku.~


Edited by - Cyphin78 on 11/3/2004 11:38:38 AM

Best Way? Compare String To List Of Strings(RESOLVED)
Trying to figure out the best way to approach this.

Basically I need to compare files(different each time) against a list of other strings to see if the file contains any of the strings(will be adding new ones to the list as I go on). I'll try to explain a bit more. For an example let's say I have 10 files and a list of 20 strings to look for. Keep in mind that when running live it will be processing 100's of files and looking for maybe 100+ strings so I want to make sure I code it optimal.

Not sure the best way to store the list to check for because I want it to be easy to add new ones to. Does it make sense to store in listbox and add new ones to it. Read file1 into a variable, loop the listbox items and check for Instr on the file1 contents, then read file2 and do the same thing?

Seems like there would be a better way to handle this.

Any suggestions appreciated.

How To Compare Partial String From A Text With Out Spliting It?
Hey Guys

I am looking for a way to find if a text includ a certain word or a sentence with out spliting the entire text into a array. can this be done?

Thanks

Concatenating Two Fields To Form A String To Compare Against A UCase ?
Im trying to use a UCase LIKE Search...

This is okay if I only want to search a word/words from one field, but how do I do it if I need to join 2 fields ?

Eg. I have 2 fields CustomerFirstname and CustomerSurname

What happens if the user types into the search "VisualBasic Kid"
where VisualBasic is the CustomerFirstname and Kid is the CustomerSurname ?

It won't find anything...

Maybe someone can take a look at my string and tell me where I'm going wrong...


Code:
Select * From Customer Where UCase(CustomerSurname) LIKE
'%" & UCase(txtSearch) & "%' OR (UCase(CustomerFirstname) &
UCase(CustomerSurname)) LIKE '%" & UCase(txtSearch) & "%'", db,
adOpenStatic, adLockOptimistic
Thanks for any help once again

Concatenating Two Fields To Form A String To Compare Against A UCase ?
Im trying to use a UCase LIKE Search...

This is okay if I only want to search a word/words from one field, but how do I do it if I need to join 2 fields ?

Eg. I have 2 fields CustomerFirstname and CustomerSurname

What happens if the user types into the search "VisualBasic Kid"
where VisualBasic is the CustomerFirstname and Kid is the CustomerSurname ?

It won't find anything...

Maybe someone can take a look at my string and tell me where I'm going wrong...

Code:
Select * From Customer Where UCase(CustomerSurname) LIKE
'%" & UCase(txtSearch) & "%' OR (UCase(CustomerFirstname) &
UCase(CustomerSurname)) LIKE '%" & UCase(txtSearch) & "%'", db,
adOpenStatic, adLockOptimistic


Thanks for any help once again

Function To Find First Digit Or Compare Numerics In Text String
I'm looking for a Worksheet function formula or VBA function to report the character position of the first digit in a text string.
Or ultimately a function to compare the first occuring numeric value within a text string. Can this be done?

When comparing two strings such as these:
Grade 02
Grade 2

or

Grade 2
Grade 3 Lvl 1

I want to get alerts (vba) where the one in the 2nd row is a higher digit or grade than 1st row eg. In two these examples the first pair are essentially the same level (no alert) but in the 2nd pair the 2nd row is a higher grade and I want an alert. Just need the boolean which can be used to color the cells, or msgbox or whatever.
What is the most efficient method of doing this?

Find String In Text File And Compare What User Types
hallo, ok so what i want to do i want to put numbers into a text file alot of em in this order

719
121
233
121

like a different number each line and i want visual basic to find a certain string while the user types the 3 digit code an display text like

if area1.text = "719" then
label1.caption = "Colorado"
Else ?????????????????? like go threw the whole list finding what the user types and display info about it ty for your help

How To Compare Date Field In MS ACCESS That More Than 2year Compare To Sysdate In Sql
How to compare Date field in MS ACCESS that more than 2year compare to sysdate in sql


this is my simple logic... but not work....


Code:
SELECT ACName,year(InDate)
FROM ACInfo
HAVING (year(date()) - Max(year(InDate))>=2)
GROUP BY ACName

Compare String In FlexGrid Cell To Excell Sheet Cell
I have a string in a cell of a flexgrid that I want to compare to a string in an excel sheet cell

I tried doing this:
MsFlexGrid1.Col=0
MsFlexGrid1.Row=0

If MSFlexGrid1.Text = XLSheet3.Cells(3, 1) Then

'Do the stuff I want to do

End If

But it gives me a runtime error and points to this.

Are they of different types? How can I compare these two strings?

String Containing XML Into ADO Recordset
Long time no post.

Anyway, I have some XML in a string. I want to get this into an ADO recordset, but I want to do it memory rather than save it and re-open it. Any ideas?

Thanks.

Using A String To Set Recordset
I am looking to set a recordset based on a string variable. Let me explain...

My call should looks like this..
Set rs = RunSPReturnRS("pkg_static_data.getIP_Module_data")

I would like to be able to do this...
strRScall = RunSPReturnRS("pkg_static_data.getIP_Module_data")
Set rs = strRScall

I keep getting a 'type mismatch' error. Any advice?

Please advise. Thanks.

Using A String To Open A Recordset
I am using a inputbox to search and open a recordset. the user types in the doc# he wants to work on. it will select * and open the recordset. on the form there is a grid that shows all the records for the line item the user typed into the inputbox. what I am trying to do is, create a button that when the user clicks on it, A inputbox will pop up it will ask him for the next line item he wishes to move to. sine the doc# is already in a textbox on the form I wanted to take that number and take off the last three characters, then add what ever the user puts into the inputbox and open the recordset. the reason I am doing this is a rs.movenext will not work. the form only will show the first record in the recordset but the grid will show all the records in the same recordset. so, if I did a rs.movenext and there was fifty records, the user would have to click the button fifty times until the next record.

I tryed the code below but cant make anything work..

can someone help.

sName = Trim(InputBox$("Please Enter Doc# Below..")) ' & "%"

strRs = "SELECT * FROM table1 WHERE doc# = Left(Text1.Text, Len(Text1.Text) - 2) & sName"""

Thanks in advance


dvannoy@onyxes.com


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