Accessing a Query from a form

G

Guest

I need to be able, from a form, to access the same table the form's source is
and advance to the same record in the table as is selected in the form.
Currently I have the form load a query with a button that simply shows all of
the feilds with no criteria. My boss wants the query to advance to the same
record that is being viewed in the form. Thanks for your help.
 
G

Guest

Hi William

I need to be able, from a form, to access the same table the form's source is
and advance to the same record in the table as is selected in the form.

I think you need to tell your boss (politely) that this is a very idea.
There is no reason why anyone except the developer should ever need to look
at the table itself. Table are form storeing data and not for bosses to look
at (they have a habit of "managing" things that don't need to be "managed") .
Any information can be viewed on the form.
 
K

Kc-Mass

The Command Button you installed has code
in the onClick event of the button.

It probably has something like
"DoCmd.OpenQuery stDocName, acNormal, acEdit"

The variable stDocname holds the name of the query to be executed.

Let's say that you have a TextBox named txtSSN and when you click the button
you want all fields to be populated by the data in the record containing the
SSN that was typed in. Also your underlying table has a field named "SSN".
Your query has to contain a column for SSN with criteria that references the
value of the txtSSN box. So if a user types in and SSN of "111223333", the
query will execute with a where clause of SSN = "111223333".

Kevin C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top