result of a query in code

hair

Registered User.
Local time
Today, 23:59
Joined
Mar 27, 2003
Messages
125
How do I reference the result of a query in code? Is it something like Querys!Blabla? What is the exact syntax? Thank you
 
What do you mean by 'result'?

A query won't return you a value; it will return records.
 
its like this in jungle language :

subform x set up the source table x
added a combo from some other table linked(table y)
when I modify the combo
I want as a aftermodify event to update a field on subform x
whats the easiest way?

table x : noA 'FK, noB, ....
table y: noA 'PK , NameA

On the subform tablex I added a combo with the source set to NameA

Now, when I choose a name I want to update the noA on the subform with the proper value

Which I thought it would be something like

SELECT noA from table y WHERE tabley.nameA =
Forms!subformx.mycombo;

it ain't move its but to work though
so here I am saying please help the enemy
 
Lookup, as Rich said albeit minimally, the domain aggregate functions such as DLookup, DSum, DAvg, DCount, etc. which can get actual values from a recordset.
 
You don't need the combo in the table, only the form, change the table display to a text box.Requery the subform control on the AfterUpdate event of the first combo
 
the combo is on the form
ANd I've putthis behind the after modify event :

Private Sub nomclient_AfterUpdate()
Dim searchnumber As Variant

searchnumber = DLookup("[noclient]", "Clients", "nomclient=" & Forms![Plan sous-formulaire]!noclient)



Me.noclient = searchnumber


End Sub

Says it ain't handle it blabla
I have looked in the Dlookup syntax and it seems to ne right as I did it
Is it something obviously wrong in it?

I attach the pacient here maybe u taka a look
 

Attachments

i've got only 2000 version but if its a prob I can eventualy install 97. I didn't think about access hippies :-)
 
Many posting here must be hippies then:cool:
You don't need 97 installed, you have the option to save as a previous ver
 
I don't find the option to save it in 97 format. That is an option only when you create the base or after too?
 
I think it's under: Tools -> Convert to Access 97 Format
 
I avoided the problem usinf a query as the source of the sub form. It is healthier and it works
 

Users who are viewing this thread

Back
Top Bottom