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

Can't locate table or query source....

Status
Not open for further replies.

PatTheCat

Programmer
Jan 16, 2003
1
CA
(first let me say i'm sorry for my level of english...)
here is the problem;
I produce a recordset from a save query (code to follow...) then I want to extract the first colum of that recordset and group it. I tried with the sql statement but at execution, the recordset cant be found.

I did look at the variable... an it is listed and the content is ok. but it is not listed under the database, its listed under my module name...

can somebody help please...
thank for youre time...
Patrick Haines

here is the code;
Dim MaBD As Database
Dim rstTemp As Recordset
Dim strCritere As String

Set MaBD = CurrentDb

Set TableDef = MaBD.QueryDefs(NomReq)
TableDef.Parameters("MoisCour") = MoisCour
Set TableTest = TableDef.OpenRecordset()

If TableTest.EOF Then
MsgBox "aucun rapport à produire pour cette date"
Else
strCritere = "Select An from TableTest;"
Set rstTemp = OpenRecordset(strCritere)
...
 
PatTheCat:

First let me say that your command of English is 98% better than my command of French or any of its derivatives. :)

Where does this code reside? Is it in a text box event? Is it in a form event? When should this code run; i.e., what will be the triggering mechanism that starts this code? Also, what is the record source for this form? Could you show an example of the SQL for the record source?

Is the save query created from data in a table or tables, and is MoisCour a field name in your query, therefore in a table, which contains the data you need? Are you trying to determine if that field is blank? If so, when you initially enter data into your table, why not make that field a required field? That way the record will not be written into the table unless there is data in the field.

I'm not quite sure what you are trying to accomplish. I am interpreting the last line in your code as meaning you want some sort of table to open up on screen so that a user can select a value. If that is the case, then a combobox with a dropdown is probably the better solution for this part of your code.

Since there are several errors in syntax in your code, it would be best if you could be a little more specific on what you are trying to accomplish. Helping you fix the syntax as written will probably not solve your problem without understanding what you want to do.

Vic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top