two joined querys ?

ctuna02

Registered User.
Local time
Today, 07:31
Joined
Dec 29, 2002
Messages
27
:confused: I have a working query that is the result of two joined querys . When I Open a recordset it looks like I would need to put in both querys in order to make things work . How would this be coded?
 
When in design view for your working query, click on
View --> SQL View.

It will show you the underlying SQL.

Wayne
 
Thanks for your reply
I know how to get the the SQL statements and first I thought I had to move the whole def inside the code . So since this compromizes two SQL statements from joined Querys how do I get two joined querys work inside a recordset . Then I realized I shouldn't have to move the SQL statements inside but just call it the way you would call a table by putting it inside the CurrentDb.OpenRecordset Command. Currently I'm having this probelm.
Private Sub Command39_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("qryProbeCardtouchdowncount", dbOpenDynaset)
MsgBox ("The Current Probe Card No is" & rst![Altera Probe Card No])
MsgBox ("The Current Record is " & rst!ID)
MsgBox ("The Last Probe Count is " & rst!CurrentProbeCount)
Me!LastProbeCount = rst!CurrentProbeCount

Error 3061 to few parameters when it hits the Set rst = Line

This is the first time I have tried to use querys in code so I'm a little unsure as to what is legal and what is not.
 
Last edited:
Thanks for your replys and help.
The query is based on the same table that the form is based on .
The query was first used to genrate a report of the status of hardware where the most recent date of entry for each item is displayed . I modified query with a criteria such that the field for hardware is criteria and the record for the last time a specific piece of hardware was used is pulled up . I then wanted to pull a numerical field out and add it to the new record. If I can get it out and into the field the rest will be easy. I'm not sure I even have to
open a recordset to do this? I tried setting the field name equal to the query and the specific field and it said it couldn't find the query .

I'm not sure of the rules for querys inside recordsets
1) Can you just refer to the external(when the recordset isn't open ) query def for one the querys to make it work?
2) The parameter error is caused be the fact that access cannot
get the value from the open field on the form inside the recordset?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom