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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move to a record using an InpuBox

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
we receive documents that have several line items. on each line item there could be several pieces. I am using a grid so the user can enter data for each piece in a line item.

I am using an input box that ask's the user to enter the doc# and then moves to that record. what i need to do is,(behind a button) have an inputbox that ask's for the next line item they wish to move to. so i was trying to make the following code work..

rs.Movenext will not work. there could be 100 pieces per line item. they would have to hit the button 100 times before moving to the next record..

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

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

I want it to strip the last to digits from the doc#

eg..123456-1A

I want it to strip the 1A and the user puts 1B into the inputbox and it jumps to that record..

I cant make the above code work...

Any help would be appreciated

Thanks


dvannoy@onyxes.com
 
Hello

You're nearly there, try the following.

Code:
sName = Trim(InputBox("Please Enter Doc# Below.."))

strRS = "SELECT * FROM table1 WHERE doc# = " & Left(sName, Len(sName) - 3)

Check that the condition field 'doc#' is called exactly that.

Hope this helps
 
The doc# is already in a field called text1...all I want the user to do is put in the line item into the inputbox..

eg...1B etc..

thats why I am trying to cut off the last three digits of text1 and replace it with what ever the user puts into the inputbox then open that record..


sName will call the inputbox..which they will enter the line item they need.

Thanks dvannoy@onyxes.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top