RE: Query under button
- From: "MarcVdb" <MarcVdb@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 08:37:01 -0700
I'm using this code: but the result is
"Operations is not allowed when the object is closed."
Dim rstRS As New ADODB.Recordset
Set rstRS = New ADODB.Recordset
strSQL = "SELECT ORDefault.ORID, ORAnomalie.ANOmschr FROM " & _
"ORDefault, ORAnomalie WHERE ORDefault.ORID=3125 and " & _
"ORAnomalie.ORID=3125"
' Set rsrRS = CurrentDb.OpenRecordset(strSQL, dbOpenForwardOnly,
dbConsistent, dbReadOnly)
Set rsrRS = CurrentDb.OpenRecordset(strSQL)
Do While Not rstRS.EOF
strTextAno = strTextAno & ORAnomalie.ANOmschr & " "
Loop
"MarcVdb" schreef:
> 2 tables: a) main table with task information
> b) second table with details per task (many rows referring to same task)
>
> How and which query to run when activated by button on a form.
> Purpose: to produce a Word doc with taskdescription (from table1) and
> under the description all the rows with detail-information.
>
> The selection has to take place in code activated by the button.
> Then a loop to browse through the different returned rows (only those that
> match the task nr).
>
> (the connection to word works)
> But I'm not an expert in access and loose myself in de different docmd.
> possibilities
> or is this the wrong option to go.
> I have no idea how to make that inner selection nor how to browse trough the
> returned results without the need to show the selection-result to the user.
> The user only wants the word-doc with the details presented.
>
> I hope this is clear.
> thanks a lot.
.
- References:
- Query under button
- From: MarcVdb
- Query under button
- Prev by Date: Division by Zero
- Next by Date: Re: Division by Zero
- Previous by thread: Query under button
- Next by thread: Print off multiple reports based on combo box selection
- Index(es):