PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Re: Macro for findrecord

 
 
Steve Schapel
Guest
Posts: n/a
 
      9th Jul 2003
Your syntax of =[txtLookupNum] is correct and should work ok.
However, you would need to use a GoToControl action before the
FindRecord action to set the focus to the control on the form which is
bound to the field whose value you are looking up.

- Steve Schapel, Microsoft Access MVP


On Wed, 9 Jul 2003 09:39:59 -0700, "chas" <(E-Mail Removed)> wrote:

>Hi,
>
>not 100% sure but .... try putting in the full forms
>reference to the control that has the value....
>
>=Forms![NameOfYourForm]![txtLookupNum]
>
>hth
>
>chas
>
>>-----Original Message-----
>>I am trying to use a macro to "findrecord"
>>i have a cmd button that calls the macro to find a record
>>in a table
>>if i put my string into the "Find What" part of the
>>macro, the focus goes to that matching record (which is
>>what i want to happen) however, i want the "Find What"
>>part to check a textbox and look for that string
>>(txtLookupNum).
>>if i put =[txtLookupNum] in the "Find What" part, it
>>doesn't work.
>>PLEASE HELP !
>>my deadline is approaching to quickly
>>
>>i am linking to a oracle db table and the table imports
>>fine and all the records can be navigated through via the
>>control at the bottom of my form. however i need to be
>>able to search a reference field and display the matching
>>record. if there is a better way, please let me know
>>.
>>


 
Reply With Quote
 
 
 
 
corillio
Guest
Posts: n/a
 
      9th Jul 2003
i found some code that works but now have new problem.
1st, here is the code that is working:

Private Sub cmdFind_Click()
Me.txtRefNum.SetFocus
DoCmd.FindRecord "*" & Me.txtLookupNum & "*"
Me.txtLookupNum.SetFocus
End Sub

when the user hits the cmdFind button it shows me the
record (yippee !) however, if there is more than one
record in the dataset that matches the criteria, how do i
continue to click the cmdFind and it go to Next ?

example: say i enter 123 and there are 3 records
containing that data, how do i have it show next each
time i hit the button until all records are done or new
string is typed into the lookup box ?
>-----Original Message-----
>Your syntax of =[txtLookupNum] is correct and should

work ok.
>However, you would need to use a GoToControl action

before the
>FindRecord action to set the focus to the control on the

form which is
>bound to the field whose value you are looking up.
>
>- Steve Schapel, Microsoft Access MVP
>
>
>On Wed, 9 Jul 2003 09:39:59 -0700, "chas"

<(E-Mail Removed)> wrote:
>
>>Hi,
>>
>>not 100% sure but .... try putting in the full forms
>>reference to the control that has the value....
>>
>>=Forms![NameOfYourForm]![txtLookupNum]
>>
>>hth
>>
>>chas
>>
>>>-----Original Message-----
>>>I am trying to use a macro to "findrecord"
>>>i have a cmd button that calls the macro to find a

record
>>>in a table
>>>if i put my string into the "Find What" part of the
>>>macro, the focus goes to that matching record (which

is
>>>what i want to happen) however, i want the "Find What"
>>>part to check a textbox and look for that string
>>>(txtLookupNum).
>>>if i put =[txtLookupNum] in the "Find What" part, it
>>>doesn't work.
>>>PLEASE HELP !
>>>my deadline is approaching to quickly
>>>
>>>i am linking to a oracle db table and the table

imports
>>>fine and all the records can be navigated through via

the
>>>control at the bottom of my form. however i need to be
>>>able to search a reference field and display the

matching
>>>record. if there is a better way, please let me know
>>>.
>>>

>
>.
>

 
Reply With Quote
 
 
 
 
chas
Guest
Posts: n/a
 
      10th Jul 2003
Hi Steve,

thanks for the clarification.

chas

>-----Original Message-----
>Your syntax of =[txtLookupNum] is correct and should work

ok.
>However, you would need to use a GoToControl action

before the
>FindRecord action to set the focus to the control on the

form which is
>bound to the field whose value you are looking up.
>
>- Steve Schapel, Microsoft Access MVP
>
>
>On Wed, 9 Jul 2003 09:39:59 -0700, "chas"

<(E-Mail Removed)> wrote:
>
>>Hi,
>>
>>not 100% sure but .... try putting in the full forms
>>reference to the control that has the value....
>>

Snipped
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findRecord macro error in FindRecord Action =?Utf-8?B?RmlsZW1ha2VyUHJvX0RldmVsb3Blcg==?= Microsoft Access 0 10th Jan 2007 08:43 PM
Access 2003, SQL, Docmd.findrecord "findrecord not available now" =?Utf-8?B?RWxhaW5l?= Microsoft Access Form Coding 5 31st Aug 2006 02:22 PM
FindRecord (Macro) and then add one for a new record? (resend) =?Utf-8?B?VGFtbXk=?= Microsoft Access Form Coding 37 7th Dec 2004 05:53 PM
Access 2003 Macro FindRecord =?Utf-8?B?UmVuZWU=?= Microsoft Access Macros 1 4th Dec 2004 06:40 PM
FindRecord macro not finding the record on Amend Member Details form =?Utf-8?B?Sm9zZXBo?= Microsoft Access Macros 1 10th Jan 2004 07:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:20 PM.