Calling Queries with parameters from form events

  • Thread starter Thread starter M.McDoom
  • Start date Start date
M

M.McDoom

Hi,

I have a form from which I need to run a query. However, the query
needs to have a parameter passed to it. Is there a way that I can run
the query while passing an argument to it? I don't want the user to
have to type into a pop-up box, but rather I want to type into that
event handler a message.

Does anyone know how to do this, or what the syntax for that is.

I am familiar with programming, and programming languages, and I want
to call the query like I call a function in C or C++, with a parameter.
However, I don't know VB. If anyone has any sample code, I could
probably hack it, but it seems to me that there should be a way to do
this without VB.

Thanks.
 
"Run a query" is this an action query or do you want to open the query in
datasheet view?
What kind of parameter do you want to supply to the query?
What does any of this have to do with "form events"?
 
Hi Duane!

Thanks for answering my question so quickly. =)

"Run a query" is an Update or Append query. I am interested in
"logging" changes in another part of the database by writing old and
new values to the end of "log" table.

I want to supply the query with the record number that is changing, so
it can write that value to the log file.

It has to do with "Form Events" because when someone changes the value
in the form, I want it to trigger this query or sequence of queries.

If you feel like I am approaching this in completely the wrong way, I
am more than willing to listen to an alternate suggestion. =)

Again, thanks for your help! =)
 
Hi Duane,

Thank you very much for this reference. It was truely a great resource
and help. I was able to modify the code and make it applicable to my
database.

Cheers!
Maya
 
You need to thank Access MVP Roger Carlson for his great site with all the
useful samples....
 
Back
Top