Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple entries in single record (search)

Status
Not open for further replies.

flowinlikacoolbreeze

IS-IT--Management
Joined
Jan 15, 2001
Messages
9
Location
US
Hi,
I have a record that must contain all the intgers between 10021 and 69999. I cannot list them out delimited.. i.e, 10021,10022,10023 on thru 69999 because of character limitations (right)?

Anyway, I have simple input windows for the users to hunt for these numbers and provide a recordset if, say 10023 is found. Can I utilize a simple funtion like 'BETWEEN' in a record. I love Access but I am not the best programmer.

Thanks in advance.
 
You dont mean record... you mean a field i believe... like:
row 1 value is 10021
row 2 value is 10022
etc..

Am i correct?

Bill

 
If the above is true then this should work

Dim ThisDatabase As Database
Dim RcdSt As Recordset
Dim TableName As String
TableName = "YourTablesName"
Set db = CurrentDb
Set rst = ThisDatabase.OpenRecordset(TableName, dbOpenDynaset)

With rst
.MoveFirst
Do Until .YourFieldName = 69999
.Edit
If .YourFiledName > 10021 Then
.YourFieldName = 10021
Else
.YourFieldName = .YourFieldName + 1
.Update
.MoveNext
End If
Loop
End With
 
oops change

Dim db As Database
Dim rst As Recordset

sry
 
No, your code is good but not in my situation.

We have a single record within a recordset with over 6000 entries. I.E., So within the cell is 10021,10022,10023,....69999 all delimited with a comma. I need code to read thru the string. So if the user is searching for 10035 the code would return that row.



 
Are the numbers always consecutive?

Bill
 
How about this....

select myfield from mytable where instr([myfield],"10035")>0

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top