Goto record using touch screen

anchamal

Registered User.
Local time
Today, 13:15
Joined
Mar 7, 2010
Messages
57
I CREATED NUMERIC BUTTONS TO NAVIGATE THROUGH RECORDS.
ONCE I TYPE THE NUMBER I NEED TO CREATE THE ENTER KEY SO THAT I CAN GO TO THE SPECIFIG RECORD.

I HAVE THE FOLLOWING CODE:

Me.Combo117 = Me.Combo117 & "2" AND SO ON FOR ALL NUMBERS.

FOR THE ENTER KEY I HAVE:
Me.Combo117.SetFocus
DoCmd.GoToRecord = Me.Combo117

BUT I GET ERROR AND I CAN NOT FIGURE OUT ANY SOLUTION.

THANKS IN ADVANCE
 
1. it shouldn't be a combo but it should be a text box that is capturing your input.

2. You use the FindFirst method to go there. Take a look here.
Code:
Dim rst As DAO.Recordset
 
Set rst = Me.RecordsetClone
 
rst.FindFirst "[IDFieldNameHere]=" & Me.Combo117
 
If rst.NoMatch Then
    MsgBox "No Match Found"
Else
    Me.Bookmark = rst.Bookmark
End If

And you should rename your controls to something MEANINGFUL. Combo117 is not descriptive and doesn't help you, or someone else, coming along a year later and then needing to go figure out what exactly it is doing.
 
first of all thanks for your reply

the solution you gave me works for the items in the id that are only number.

but the items that i'm looking have letters also. eg CH121 which is located in the BDCODE field. so i changed into something like this:

Dim rst As DAO.Recordset

Set rst = Me.RecordsetClone

rst.FindFirst "[BDCODE]=" & Me.Text121

If rst.NoMatch Then
MsgBox "No Match Found"
Else
Me.Bookmark = rst.Bookmark
End If

the result i'm getting is runtime error.

thanks again for the time you spend on my questions
 
"[BDCODE]=" & Me.Text121

is correct syntax for a field defined as a Number.

For a field defined as Text (alpha-numeric) such as your [BDCODE], the correct syntax would be

"[BDCODE] = '" & Me.Me.Text121 & "'"

Also, please don't enter posts in all caps. In on-line forums/newsgroups this is considered to be shouting, and more importantly, it makes reading/scanning your posts more difficult.

Thanks!

Linq ;0)>
 
first of all sorry for using capital letters. it was not intented.

finally my problem has ended thanks to your help.

if you ever visit CYPRUS..... email me

thanks a lot again
 

Users who are viewing this thread

Back
Top Bottom