reading data in a field & assigning to a variable

diversoln

Registered User.
Local time
Today, 04:39
Joined
Oct 8, 2001
Messages
119
I'd like use an event procedure module to locate a record where the data is equal to the value of a variable (each record is unique). Once the record is found, I'd like to assign a variable to the contents of each of the other two fields in that record.

It seems like this should be an easy thing to do, but I'm just not seeing it in the help index. Thanks.
 
What you are asking is not clear.

I think your problem is that you wouldn't use an event procedure to do this normally. Event routines don't fire unless some action occurs. I.e. if you don't touch a key, mouse, or have a running timer, no events will kick in. So an event routine won't "find" anything because finding requires an action that would change the current record.

You might want to write a procedure (in a general module) that steps through a recordset, examines each record, and extracts what you want when the right record comes along. This could be kicked off by a RunCode action or method caused by a form's OnLoad or OnCurrent event. To be eligible, the procedure would have to be a public function, though it might not matter what it returns as a value.
 
I am trying to use an event procedure in the following way:

On a form, I enter text into an unbound textbox then CLICK a "Continue" button that initiates the event. Now what I'd like to do is find a unique record in a table that has a field whose contents are equal to the text I typed in. Then, I'd like to extract the other values of the data in the two other field for that same record. What I'm looking for is the name of the statement that extracts the data. I've been reading help on FIND, GET and READ etc., but these don't seem to apply. There must be a command that applies to extracting data from a table and saving it to a variable but I can't seem to put my finger on the command name.
 

Users who are viewing this thread

Back
Top Bottom