Recall field value from code

Treason

#@$%#!
Local time
Today, 07:19
Joined
Mar 12, 2002
Messages
340
I have a table with basic school information, ex. term#, and school#. There is only one record in this table never more. This data is not changed frequently but only once a term or twice a year. I need to retrieve the School# and Term# in several queries. But there is no link between the School information table and the other tables. So i cannot create any relationship to make the query run, with the school # populated in every record. I guess I would like create a function that calls the value from that table so then I could use that function in the queries. Maybe I am going about this the wrong way, so I am ready to get flamed =]

Any ideas on what I can do? Sorry for the lameness... I cant help myself sometimes :p
 
You could always write a li'l VBA function called ReturnSchool or something that looks at the lonely one record and returns the value.

BUT

I for one am curious as to why you have a table which has no relationships yet holds information that will end up on "every record" as some other point... that sounds like it might be a design question?

--Intrigued Mac
 
this info is only used once or twice in an export to txt file query. So I hope it's not a design problem. Does anyone know how to create a function that retrieves the field value?
 
I do something like that for storing criteria values in a table with only one record. I have a field in the table named RecordID and the value is always "1" [no quotes]. That way I can easily modify (using an update SQL) and retrieve (using DLookup) my criteria values for the "1" record.

Then I use the DLookup Function to retrieve the data. Check the help files for the DLookup Function for some examples and more details.

HTH
 

Users who are viewing this thread

Back
Top Bottom