VB refresh query

El-d

Registered User.
Local time
Today, 13:12
Joined
Mar 20, 2013
Messages
32
Hi all,

Probably a newbie question but can't see an answer.

I have a query that I run to extract some values for calculations. Its run on an event based on a dropdown selection. At the moment, I run via:

Code:
DoCmd.OpenQuery "CallMidprice"
and then close it.
this seems to take more time than is necessary when I only want to refresh the results.
Open query without close, switches to the table but doesn't update until I press F5.

When I try requery I get an error.
"Runtime error '2109': There is no field named 'CallMidprice' in the current record.
Requery without 'Callprice' seems to requery my form.

Sure its something simple and I'm just misunderstanding what its doing but have been going round in google circles without a solution :(

using 2013 access .
Cheers,
El-d
 
Sounds like a complex way of doing things. You can execute a query without needing to open it.

Can you possibly upload a cut down version of your db so that we can see how you've set this up?
 
I'm away at the moment so won't be able to sort a cut down version yet.

How do I execute a query though without opening? Googling Running a query via vb always seem to come up with do.cmd openquery or requery.

Thanks

El-d
 
We'll need to see the full picture El-d. Let us know when you're able to do the upload.
 
Sorry. Up to my eyes in my actual work and probably won't get chance to look at this again for a while :(
However, I did remove my open command and my values are still coming through so I'm obviously updating my query somewhere. The hazards of self teaching via trial and error :)
 

Users who are viewing this thread

Back
Top Bottom